You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/11/10 14:10:01 UTC

[GitHub] [kafka] showuon commented on a change in pull request #11451: KAFKA-13419: resetStateAndRejoin when rebalanceInProgress in syncgroup

showuon commented on a change in pull request #11451:
URL: https://github.com/apache/kafka/pull/11451#discussion_r746622616



##########
File path: clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
##########
@@ -443,7 +443,9 @@ boolean joinGroupIfNeeded(final Timer timer) {
                     stateSnapshot = this.state;
                 }
 
-                if (!generationSnapshot.equals(Generation.NO_GENERATION) && stateSnapshot == MemberState.STABLE) {
+                if ((generationSnapshot.generationId != Generation.NO_GENERATION.generationId ||
+                    !generationSnapshot.memberId.equals(Generation.NO_GENERATION.memberId)) &&
+                    stateSnapshot == MemberState.STABLE) {

Review comment:
       Before this change, we'll always reset generation object to `NO_GENERATION`, but now, we'll have some cases that only reset generation ID. Since after rebalance complete, consumer should have a valid generation ID. No generation ID (i.e. -1) also means the consumer needs to rejoin group. So change the if condition here.  




-- 
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