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

이선민 edited comment on KAFKA-21610 at 11/24/26, 10:40 AM:
---------------------------------------------------------

Thanks [~squah-confluent]. I reproduced the first case with just the skip in 
place. Initialization finished before the ack heartbeat, and the member 
received its partitions on HB3. As your second table shows, if initialization 
finishes after the ack, the coordinator has to wait until HB3 just to schedule 
the assignment run. I see why we should trigger it from 
\{{initializeShareGroupState}} too.

I also misunderstood question 2. For a fresh group, the first initialization 
request covers all subscribed partitions, and \{{initializeShareGroupState}} is 
called once they've all been initialized.

I'll skip the empty assignment while a fresh group is waiting for 
initialization. To trigger the run from \{{initializeShareGroupState}}, I'm 
planning to use a timer callback, following the pattern used for the streams 
initial rebalance delay. That way the run can read the initialized partition 
metadata after replay without needing a heartbeating member. I'll open a PR 
with tests for both cases, one where initialization finishes before the ack 
heartbeat and one where it finishes after.
 


was (Author: JIRAUSER314548):

Thanks [~squah-confluent]. I reproduced the first case with just the skip in 
place. Initialization finished before the ack heartbeat, and the member 
received its partitions on HB3. As your second table shows, if initialization 
finishes after the ack, the coordinator has to wait until HB3 just to 
schedule the assignment run. I see why we should trigger it from 
{{initializeShareGroupState}} too.

I also misunderstood question 2. For a fresh group, the first initialization 
request covers all subscribed partitions, and {{initializeShareGroupState}} 
is called once they've all been initialized.

I'll skip the empty assignment while a fresh group is waiting for 
initialization. To trigger the run from {{initializeShareGroupState}}, I'm 
planning to 
use a timer callback, following the pattern used for the streams initial 
rebalance delay. That way the run can read the initialized partition metadata 
after replay without needing a heartbeating member. I'll open a PR with tests 
for both cases, one where initialization finishes before the ack heartbeat 
and one where it finishes after.

> 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