In the following scenario sticky assignor assigns a topic partition to two consumers in the group:
- Create a topic test with a single partition
- Start consumer c1 in group sticky-group (c1 becomes group leader and gets test-0)
- Start consumer c2 in group sticky-group (c1 holds onto test-0, c2 does not get any partition)
- Pause c1 (e.g. using Java debugger) (c2 becomes leader and takes over test-0, c1 leaves the group)
- Resume c1
At this point both c1 and c2 will have test-0 assigned to them.
The reason is c1 still has kept its previous assignment (test-0) from the last assignment it received from the leader (itself) and did not get the next round of assignments (when c2 became leader) because it was paused. Both c1 and c2 enter the rebalance supplying test-0 as their existing assignment. The sticky assignor code does not currently check and avoid this duplication.
Note: This issue was originally reported on StackOverflow.
- is caused by
KAFKA-2273 KIP-54: Add rebalance with a minimal number of reassignments to server-defined strategy list
- is duplicated by
KAFKA-6717 TopicPartition Assined twice to a consumer group for 2 consumer instances
- links to
- mentioned in