Skip to content

Conversation

@dajac
Copy link
Member

@dajac dajac commented Jan 14, 2026

This fix allows members to rejoin a consumer group with memberEpoch=0
after being fenced, as specified by KIP-848. Previously, the validation
in throwIfConsumerGroupMemberEpochIsInvalid rejected epoch=0 when the
member had a higher epoch on the server.

Changes:

  • Add early return for receivedMemberEpoch=0 in validation method
  • Add unit tests for rejoin in STABLE, UNREVOKED_PARTITIONS, and
    UNRELEASED_PARTITIONS states
  • Add integration test for fenced member rejoin flow

Reviewers: Dongnuo Lyu dlyu@confluent.io, Sean Quah
squah@confluent.io, Lianet Magrans lmagrans@confluent.io

This fix allows members to rejoin a consumer group with memberEpoch=0
after being fenced, as specified by KIP-848. Previously, the validation
in throwIfConsumerGroupMemberEpochIsInvalid rejected epoch=0 when the
member had a higher epoch on the server.

Changes:
- Add early return for receivedMemberEpoch=0 in validation method
- Add unit tests for rejoin in STABLE, UNREVOKED_PARTITIONS, and
  UNRELEASED_PARTITIONS states
- Add integration test for fenced member rejoin flow
Copy link
Contributor

@squah-confluent squah-confluent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch!

Comment on lines 527 to 532
// Prepare assignment for rejoin.
assignor.prepareGroupAssignment(new GroupAssignment(
Map.of(memberId, new MemberAssignmentImpl(mkAssignment(
mkTopicAssignment(fooTopicId, 0, 1, 2)
)))
));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is used in any of the tests since the group epoch is not bumped?

Copy link
Member

@lianetm lianetm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just minor comment on tests

Comment on lines 528 to 532
assignor.prepareGroupAssignment(new GroupAssignment(
Map.of(memberId, new MemberAssignmentImpl(mkAssignment(
mkTopicAssignment(fooTopicId, 0, 1, 2)
)))
));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this really needed? I would expect that since nothing really changed on the GC side (we're just retrieving the state for a member that is coming back), we wouldn't need to ask the assignor to do anything. Am I missing something? (same on other tests here if this makes sense)

@dajac
Copy link
Member Author

dajac commented Jan 14, 2026

@lianetm @squah-confluent Addressed your comments.

Copy link
Member

@lianetm lianetm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

Copy link
Contributor

@squah-confluent squah-confluent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dongnuo123
Copy link
Contributor

Do we have the same issue for streams group and share group? looks like they both have similar member epoch check

@dajac
Copy link
Member Author

dajac commented Jan 14, 2026

Do we have the same issue for streams group and share group? looks like they both have similar member epoch check

Yes. I will opened separate PRs for those.

@dajac dajac merged commit 384586e into apache:trunk Jan 15, 2026
20 checks passed
@dajac dajac deleted the KAFKA-19233-1 branch January 15, 2026 10:59
@mjsax mjsax changed the title KAFKA-19233; Allow fenced members to rejoin consumer group with epoch 0 KAFKA-19233: Allow fenced members to rejoin consumer group with epoch 0 Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants