Skip to content

Fix group coordinator rediscovery after broker decommission - #5512

Open
morgando wants to merge 1 commit into
confluentinc:masterfrom
morgando:fix-send-offsets-blocking
Open

Fix group coordinator rediscovery after broker decommission#5512
morgando wants to merge 1 commit into
confluentinc:masterfrom
morgando:fix-send-offsets-blocking

Conversation

@morgando

@morgando morgando commented Jun 18, 2026

Copy link
Copy Markdown

Fixes #5511 by adding these two steps when decommissioning a broker:

  1. If the broker is in the coordinator cache, remove it so the next call to rd_kafka_coord_req_fsm() sends a FindCoordinator request instead of waiting for the stale, decommissioned coordinator to come up.
  2. If any coordinator requests (rd_kafka_coord_req_t) are waiting for a connection to the broker via rkb_persistconn.coord, wake them up so that they re-enter rd_kafka_coord_req_fsm(), see that the cache has been cleared, and send a new FindCoordinator request.

When rd_kafka_coord_req_fsm() finds a cached group coordinator that is not UP,
it returns expecting a future broker state change to re-enter the FSM.

That works when the cached coordinator is merely DOWN. The broker thread
remains alive and continues cycling through states while trying to
reconnect. Those state changes re-enter rd_kafka_coord_req_fsm(), giving
the stale coordinator cache entry a chance to age out and allowing the
FSM to send a FindCoordinator request.

Since f7c4273, brokers that disappear from metadata responses are
decommissioned, which terminates their broker thread. However, a
decommissioned broker can remain cached as group coordinator.

The bug occurs when the cached coordinator has been decommissioned. The
FSM still returns expecting a future broker state change, but the
decommissioned broker's thread has been terminated, so no state change
from that broker will occur.

As a result, the FSM may not be re-entered until some other broker
changes state, possibly much later.

The changes in this commit:

1. Remove decommissioned brokers from the coordinator cache, so the next
call to rd_kafka_coord_req_fsm() sends a new FindCoordinator request
instead of continuing to wait for the stale coordinator.
2. Trigger any waiters on the decommissioned broker, causing them to
re-enter rd_kafka_coord_req_fsm() and send a new FindCoordinator
request.
@morgando
morgando requested a review from a team as a code owner June 18, 2026 21:57
@confluent-cla-assistant

Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
✅ morgando
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

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.

rd_kafka_send_offsets_to_transaction() hangs when the group coordinator is decommissioned

1 participant