KAFKA-20442: Update streams group assignment epoch when last member leaves#22047
Merged
dajac merged 3 commits intoapache:trunkfrom Apr 15, 2026
Merged
KAFKA-20442: Update streams group assignment epoch when last member leaves#22047dajac merged 3 commits intoapache:trunkfrom
dajac merged 3 commits intoapache:trunkfrom
Conversation
…eaves When the last member of a streams group is fenced, the group epoch is bumped but the assignment epoch is not updated. This leaves the empty group with `groupEpoch > assignmentEpoch`, violating the invariant that an empty group should have matching epochs. This patch writes a `StreamsGroupTargetAssignmentMetadataRecord` when the fence operation results in an empty group so that the assignment epoch catches up to the group epoch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use a timestamp of zero in the target assignment metadata record to mimic the behavior of a new group. This avoids the assignment interval check delaying the next assignment computation when a new member joins shortly after the group becomes empty. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
squah-confluent
left a comment
There was a problem hiding this comment.
Thanks for the PR!
The test changes don't make sense given the change to fencing.
Member
the change includes regular leaving as well, or what do you mean? |
Contributor
squah-confluent
left a comment
There was a problem hiding this comment.
@lucasbru This is what I meant
Revert incorrect change in a non-fence test and use zero timestamp in the session timeout test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
squah-confluent
approved these changes
Apr 14, 2026
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 the last member of a streams group is fenced, the group epoch is
bumped but the assignment epoch is not updated. This leaves the empty
group with
groupEpoch > assignmentEpoch, violating the invariant thatan empty group should have matching epochs. This patch writes a
StreamsGroupTargetAssignmentMetadataRecordwhen the fence operationresults in an empty group so that the assignment epoch catches up to the
group epoch.
Reviewers: Lucas Brutschy lbrutschy@confluent.io, Sean Quah
squah@confluent.io