You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "chickenchickenlove (via GitHub)" <gi...@apache.org> on 2026/08/10 14:13:08 UTC

Re: [PR] KAFKA-20641: ConsumerGroup should clean up the state when a static member temporarily leaves. [kafka]

chickenchickenlove commented on code in PR #22473:
URL: https://github.com/apache/kafka/pull/22473#discussion_r3750277113


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -4259,11 +4259,27 @@ private CoordinatorResult<ConsumerGroupHeartbeatResponseData, CoordinatorRecord>
         ConsumerGroup group,
         ConsumerGroupMember member
     ) {
+        ConsumerGroupMember reconciledMember = member;
+        if (member.state() == MemberState.UNREVOKED_PARTITIONS) {
+            reconciledMember = new CurrentAssignmentBuilder(member)
+                .withMetadataImage(metadataImage)
+                .withTargetAssignment(
+                    group.assignmentEpoch(),
+                    group.targetAssignment(member.memberId())
+                )
+                .withResolvedRegularExpressions(group.resolvedRegularExpressions())
+                .withCurrentPartitionEpoch(group::currentPartitionEpoch)
+                .withOwnedTopicPartitions(List.of())
+                .build();
+        }
+

Review Comment:
   @squah-confluent 
   I’m very sorry for the delayed response. 🙇‍♂️ 
   I haven’t had much bandwidth to work on this recently. 
   
   That’s a great point. Since reconciledMember is treated as having revoked all of its partitions while in the `UNREVOKED_PARTITIONS` state, it will transition to either `STABLE` or `UNRELEASED_PARTITIONS`. As you mentioned, I agree that we should also call `cancelGroupRebalanceTimeout()` here.
   
   I’ve updated the code accordingly. Thank you for pointing this out!
   When you get a chance, please take another look! 🙇‍♂️ 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org