Commit 33ea66b
authored
KAFKA-20736: Improve share session handling on leader change (apache#22766)
In some situations, the share consumer does not tidy up share sessions
sufficiently on leadership change. In particular, if a broker loses
leadership of a partition, the share consumer should send a further
ShareFetch/ShareAcknowledge to remove the partition from its share
session. In most cases, this removal happens naturally, but it depends
upon whether the share consumer has other requests to send to that
broker. This PR tidies up the maintenance of share sessions when
leadership changes occur.
Reviewers: Lianet Magrans <lmagrans@confluent.io>, Shivsundar R
<shr@confluent.io>, Apoorv Mittal <apoorvmittal10@gmail.com>1 parent 260a397 commit 33ea66b
5 files changed
Lines changed: 710 additions & 166 deletions
File tree
- clients
- clients-integration-tests/src/test/java/org/apache/kafka/clients/consumer
- src
- main/java/org/apache/kafka/clients/consumer/internals
- test/java/org/apache/kafka/clients/consumer/internals
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| |||
1054 | 1053 | | |
1055 | 1054 | | |
1056 | 1055 | | |
1057 | | - | |
| 1056 | + | |
1058 | 1057 | | |
1059 | 1058 | | |
1060 | 1059 | | |
| |||
1083 | 1082 | | |
1084 | 1083 | | |
1085 | 1084 | | |
1086 | | - | |
| 1085 | + | |
1087 | 1086 | | |
1088 | 1087 | | |
1089 | 1088 | | |
| |||
1098 | 1097 | | |
1099 | 1098 | | |
1100 | 1099 | | |
1101 | | - | |
| 1100 | + | |
1102 | 1101 | | |
1103 | 1102 | | |
1104 | 1103 | | |
| |||
1147 | 1146 | | |
1148 | 1147 | | |
1149 | 1148 | | |
1150 | | - | |
| 1149 | + | |
1151 | 1150 | | |
1152 | 1151 | | |
1153 | 1152 | | |
| |||
0 commit comments