Skip to content

fix: KIP-394#1435

Open
piotrkowalczuk wants to merge 1 commit into
segmentio:mainfrom
piotrkowalczuk:main
Open

fix: KIP-394#1435
piotrkowalczuk wants to merge 1 commit into
segmentio:mainfrom
piotrkowalczuk:main

Conversation

@piotrkowalczuk

Copy link
Copy Markdown

Summary

ConsumerGroup could not join a group on brokers that enforce KIP-394. When the broker rejected the initial JoinGroup with MEMBER_ID_REQUIRED and returned a freshly assigned member ID, the high-level consumer treated it as a fatal error and kept retrying with an empty member ID, never making progress.

After this change, ConsumerGroup completes the two-step handshake the KIP prescribes: on MEMBER_ID_REQUIRED, it re-sends JoinGroup once carrying the broker-assigned member ID, then proceeds normally.

Behavior

Broker Before After
Apache Kafka (any version, default config) Works Works (no path change — the new code is unreachable here)
Brokers that enforce KIP-394 strictly (e.g. Tansu) Hangs in retry loop, never joins Joins on the second JoinGroup, consumes normally

No protocol-version changes. No public API changes. Defaults preserved.

Tests

  • New unit tests covering the handshake happy path, the defensive case where the broker returns the error without an assigned ID, and the cap that prevents an infinite loop if the broker keeps replying with the error.
  • New docker_compose_versions/docker-compose-tansu-060.yml for running the existing ConsumerGroup test suite against Tansu, which exercises this code path. A KAFKA_VERSION=tansu-0.6.0 env switch gates a single assertion that depends on Apache Kafka's generation-bump semantics, which Tansu does not match.

@piotrkowalczuk piotrkowalczuk changed the title KIP-394 support fix: KIP-394 May 19, 2026
@piotrkowalczuk piotrkowalczuk force-pushed the main branch 2 times, most recently from dc77da2 to 5134d5c Compare May 19, 2026 12:59
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.

1 participant