KAFKA-20434: Consumer group does not recompute assignment when static members rejoin with different assignor#22036
Open
dajac wants to merge 2 commits intoapache:trunkfrom
Open
KAFKA-20434: Consumer group does not recompute assignment when static members rejoin with different assignor#22036dajac wants to merge 2 commits intoapache:trunkfrom
dajac wants to merge 2 commits intoapache:trunkfrom
Conversation
… members rejoin with a different server-side assignor When all static members of a consumer group using the consumer protocol leave and rejoin with a different server-side assignor, the group does not recompute the target assignment. The `bumpGroupEpoch` flag only considers changes to subscribed topic names and regex but not the preferred server assignor. This patch adds a `hasPreferredServerAssignorChanged` check that compares the effective preferred assignor (falling back to the default when no member has an explicit preference) before and after the member update. The group epoch is bumped when the effective preferred assignor changes, which only happens once a majority of members has switched. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java
Outdated
Show resolved
Hide resolved
core/src/test/scala/unit/kafka/server/ConsumerGroupHeartbeatRequestTest.scala
Outdated
Show resolved
Hide resolved
core/src/test/scala/unit/kafka/server/ConsumerGroupHeartbeatRequestTest.scala
Outdated
Show resolved
Hide resolved
core/src/test/scala/unit/kafka/server/ConsumerGroupHeartbeatRequestTest.scala
Outdated
Show resolved
Hide resolved
Contributor
|
Thanks for the patch! |
- Move preferredServerAssignorChanged below updateRegularExpressionStatus to mirror the bumpGroupEpoch sub-expression order - Use .last instead of .max for epoch comparisons in the integration test - Rewrite test comments to describe intent directly Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
squah-confluent
approved these changes
Apr 13, 2026
Contributor
squah-confluent
left a comment
There was a problem hiding this comment.
lgtm, thanks for the patch!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When all static members of a consumer group using the consumer protocol
leave and rejoin with a different server-side assignor, the group does
not recompute the target assignment. The
bumpGroupEpochflag onlyconsiders changes to subscribed topic names and regex but not the
preferred server assignor.
This patch adds a
hasPreferredServerAssignorChangedcheck thatcompares the effective preferred assignor (falling back to the default
when no member has an explicit preference) before and after the member
update. The group epoch is bumped when the effective preferred assignor
changes, which only happens once a majority of members has switched.