You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "dongnuo123 (via GitHub)" <gi...@apache.org> on 2025/08/27 15:02:51 UTC

[PR] KAFKA-19546: draft [kafka]

dongnuo123 opened a new pull request, #20417:
URL: https://github.com/apache/kafka/pull/20417

   Delete this text and replace it with a detailed description of your change. The 
   PR title and body will become the squashed commit message.
   
   If you would like to tag individuals, add some commentary, upload images, or
   include other supplemental information that should not be part of the eventual
   commit message, please use a separate comment.
   
   If applicable, please include a summary of the testing strategy (including 
   rationale) for the proposed change. Unit and/or integration tests are expected
   for any behavior change and system tests should be considered for larger
   changes.
   


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


Re: [PR] KAFKA-19546: Rebalance should be triggered if the subscription is changed during group protocol downgrade triggered by static member replacement [kafka]

Posted by "dongnuo123 (via GitHub)" <gi...@apache.org>.
dongnuo123 commented on code in PR #20417:
URL: https://github.com/apache/kafka/pull/20417#discussion_r2364431920


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -2466,31 +2476,30 @@ private CoordinatorResult<Void, CoordinatorRecord> classicGroupJoinToConsumerGro
         } else {
             targetAssignmentEpoch = group.assignmentEpoch();
             targetAssignment = group.targetAssignment(updatedMember.memberId(), updatedMember.instanceId());
-
         }
 
-        // 3. Reconcile the member's assignment with the target assignment if the member is not
-        // fully reconciled yet.
-        updatedMember = maybeReconcile(
-            groupId,
-            updatedMember,
-            group::currentPartitionEpoch,
-            targetAssignmentEpoch,
-            targetAssignment,
-            toTopicPartitions(subscription.ownedPartitions(), metadataImage),
-            records
-        );
+        // 3. If it's not a downgrade triggered by static member replacement with a different subscription,
+        // reconcile the member's assignment with the target assignment if the member is not fully reconciled yet.
+        if (!bumpGroupEpoch || !downgrade) {

Review Comment:
   We only skip the reconciliation if (bumpGroupEpoch && downgrade). So if the group epoch has not changed, we will try reconciling



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


Re: [PR] KAFKA-19546: Rebalance should be triggered by subscription change during group protocol downgrade [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac merged PR #20417:
URL: https://github.com/apache/kafka/pull/20417


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


Re: [PR] KAFKA-19546: draft [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20417:
URL: https://github.com/apache/kafka/pull/20417#issuecomment-3251632075

   A label of 'needs-attention' was automatically added to this PR in order to raise the
   attention of the committers. Once this issue has been triaged, the `triage` label
   should be removed to prevent this automation from happening again.


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


Re: [PR] KAFKA-19546: Rebalance should be triggered if the subscription is changed during group protocol downgrade triggered by static member replacement [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on code in PR #20417:
URL: https://github.com/apache/kafka/pull/20417#discussion_r2359111312


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -2466,31 +2476,30 @@ private CoordinatorResult<Void, CoordinatorRecord> classicGroupJoinToConsumerGro
         } else {
             targetAssignmentEpoch = group.assignmentEpoch();
             targetAssignment = group.targetAssignment(updatedMember.memberId(), updatedMember.instanceId());
-
         }
 
-        // 3. Reconcile the member's assignment with the target assignment if the member is not
-        // fully reconciled yet.
-        updatedMember = maybeReconcile(
-            groupId,
-            updatedMember,
-            group::currentPartitionEpoch,
-            targetAssignmentEpoch,
-            targetAssignment,
-            toTopicPartitions(subscription.ownedPartitions(), metadataImage),
-            records
-        );
+        // 3. If it's not a downgrade triggered by static member replacement with a different subscription,
+        // reconcile the member's assignment with the target assignment if the member is not fully reconciled yet.
+        if (!bumpGroupEpoch || !downgrade) {
+            updatedMember = maybeReconcile(
+                groupId,
+                updatedMember,
+                group::currentPartitionEpoch,
+                targetAssignmentEpoch,
+                targetAssignment,
+                toTopicPartitions(subscription.ownedPartitions(), metadataImage),
+                records
+            );
+        }
 
         // 4. Maybe downgrade the consumer group if the last static member using the
         // consumer protocol is replaced by the joining static member.
-        ConsumerGroupMember existingStaticMemberOrNull = group.staticMember(request.groupInstanceId());
-        boolean downgrade = existingStaticMemberOrNull != null &&
-            validateOnlineDowngradeWithReplacedMember(group, existingStaticMemberOrNull);
         if (downgrade) {

Review Comment:
   now that we use `downgrade` in a few places, i wonder if we could use an if (downgrade) .. else .. instead of gating all the ifs. have you considered it?



##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -2466,31 +2476,30 @@ private CoordinatorResult<Void, CoordinatorRecord> classicGroupJoinToConsumerGro
         } else {
             targetAssignmentEpoch = group.assignmentEpoch();
             targetAssignment = group.targetAssignment(updatedMember.memberId(), updatedMember.instanceId());
-
         }
 
-        // 3. Reconcile the member's assignment with the target assignment if the member is not
-        // fully reconciled yet.
-        updatedMember = maybeReconcile(
-            groupId,
-            updatedMember,
-            group::currentPartitionEpoch,
-            targetAssignmentEpoch,
-            targetAssignment,
-            toTopicPartitions(subscription.ownedPartitions(), metadataImage),
-            records
-        );
+        // 3. If it's not a downgrade triggered by static member replacement with a different subscription,
+        // reconcile the member's assignment with the target assignment if the member is not fully reconciled yet.
+        if (!bumpGroupEpoch || !downgrade) {

Review Comment:
   I am not sure to understand why we need `!bumpGroupEpoch` here. Couldn't we need to reconcile event if the group epoch has not changed?



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


Re: [PR] KAFKA-19546: Rebalance should be triggered if the subscription is changed during group protocol downgrade triggered by static member replacement [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20417:
URL: https://github.com/apache/kafka/pull/20417#issuecomment-3301103627

   A label of 'needs-attention' was automatically added to this PR in order to raise the
   attention of the committers. Once this issue has been triaged, the `triage` label
   should be removed to prevent this automation from happening again.


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