[ 
https://issues.apache.org/jira/browse/KAFKA-7026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16523060#comment-16523060
 ] 

ASF GitHub Bot commented on KAFKA-7026:
---------------------------------------

vahidhashemian opened a new pull request #5291: KAFKA-7026: Sticky Assignor 
Partition Assignment Improvement
URL: https://github.com/apache/kafka/pull/5291
 
 
   In the current implementation of sticky assignor the leader does not cache 
the most recent calculated assignment. It relies on the fact that each consumer 
in the group sends its subscribed topics and also its current assignment when a 
rebalance occurs. This could lead to the issue described in 
[KAFKA-7026](https://issues.apache.org/jira/browse/KAFKA-7026), in which 
current assignment of a consumer is no longer valid and should be ignored. The 
solution implemented in this PR involves the leader caching the most recent 
assignment of each consumer, so the assignment reported by a consumer can be 
properly ignored if necessary.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Sticky assignor could assign a partition to multiple consumers
> --------------------------------------------------------------
>
>                 Key: KAFKA-7026
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7026
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>            Reporter: Vahid Hashemian
>            Assignee: Vahid Hashemian
>            Priority: Major
>
> 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|https://stackoverflow.com/questions/50761842/kafka-stickyassignor-breaking-delivery-to-single-consumer-in-the-group].



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to