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

이선민 commented on KAFKA-21610:
-----------------------------

Thanks [~squah-confluent]. I'd like to go with your suggestion and skip the 
first empty assignment.

For a fresh share group with no initialized partitions, I'd have 
{{maybeUpdateTargetAssignment}} skip the assignor. That leaves the group epoch 
ahead of the assignment epoch. The first heartbeat that sees initialized 
partitions can then trigger the assignment immediately, since there's no 
previous assignment timestamp to enforce the interval against. Later 
initialization batches and existing groups would follow the same path as today.

With the default settings, the member received its partitions on the fourth 
heartbeat in my trunk runs. With this change, I'd expect the third heartbeat to 
deliver them. Is it OK if I open a PR for this?

> Consider scheduling the share group assignor when share partitions are 
> initialized
> ----------------------------------------------------------------------------------
>
>                 Key: KAFKA-21610
>                 URL: https://issues.apache.org/jira/browse/KAFKA-21610
>             Project: Kafka
>          Issue Type: Improvement
>          Components: group-coordinator
>    Affects Versions: 4.5.0
>            Reporter: Sean Quah
>            Assignee: 이선민
>            Priority: Major
>
> With assignor offloading on, a new share group's first assignor run is 
> scheduled before its share partitions are initialized, so that run assigns 
> nothing. The partitions are only assigned after the next heartbeat bumps the 
> group epoch and a second run completes. That costs members an extra heartbeat 
> (see ShareConsumerCallbackTest.testAcknowledgementSentOnSubscriptionChange).
> Bump the group epoch and schedule the assignor run in 
> initializeShareGroupState instead, so the second heartbeat already receives 
> the assignment.
> https://github.com/apache/kafka/pull/24319 will add a test scenario for this. 
> Please wait until that PR has been merged before starting this work.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to