Skip to content

Handle MemberIDRequired error in joinGroup to support KIP-394 - #1444

Open
sahasan95 wants to merge 1 commit into
segmentio:mainfrom
sahasan95:fix/kip-394-member-id-required
Open

Handle MemberIDRequired error in joinGroup to support KIP-394#1444
sahasan95 wants to merge 1 commit into
segmentio:mainfrom
sahasan95:fix/kip-394-member-id-required

Conversation

@sahasan95

Copy link
Copy Markdown

Fixes #1432

What

When a Kafka broker returns MemberIDRequired (error code 79) in response
to a JoinGroup request, the client should retry the request with the
member ID assigned by the broker rather than treating it as a fatal error.

This is required by KIP-394
which was introduced in Kafka 2.2.

Why

Without this fix, consumers connecting to Kafka brokers >= 2.2 may fail
to join a consumer group entirely, resulting in an infinite error loop.

Changes

  • In consumergroup.go, after receiving a MemberIDRequired error from
    conn.joinGroup, retry the request with the broker-assigned member ID
    before propagating the error.

Testing

The existing TestConsumerGroupErrors mock-based tests pass with this change.
A full integration test requires a live Kafka broker with KIP-394 support
(Kafka >= 2.2). Happy to add one if you can point me to the right test
infrastructure or provide a test environment setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConsumerGroup.joinGroup doesn't handle MemberIdRequired (KIP-394)

1 participant