Kafka Consumer Rebalance Storm
A rebalance storm repeatedly interrupts or redistributes work. First identify the group protocol and the event that removes or fences members.
Capture Evidence
Section titled “Capture Evidence”kafka-consumer-groups.sh --bootstrap-server kafka:9092 \ --describe --group orders-consumer --statekafka-consumer-groups.sh --bootstrap-server kafka:9092 \ --describe --group orders-consumer --members --verboseCollect client logs from all members, rebalance metrics, poll gaps, callback latency, coordinator request latency, process restarts, and deployment events.
Classic Protocol
Section titled “Classic Protocol”Check:
- processing or pauses exceed
max.poll.interval.ms; - heartbeat/session settings are consistent and within broker bounds;
- GC, CPU throttling, or network loss blocks heartbeats;
- assignment strategies are compatible across members;
group.instance.idis unique for static membership;- revocation callbacks finish promptly.
Cooperative assignment reduces full revocation but does not fix member instability.
Consumer Protocol
Section titled “Consumer Protocol”With group.protocol=consumer, the broker controls heartbeat and session timing. Focus on max.poll.interval.ms, stale/fenced member epochs, coordinator health, broker group configuration, connection churn, and client lifecycle. Do not tune classic-only heartbeat properties expecting an effect.
Recover
Section titled “Recover”- Stop the crash/deploy loop or unhealthy member.
- Restore the network, coordinator broker, or downstream dependency.
- Increase
max.poll.interval.msonly when long processing is valid and bounded. - Make static instance IDs unique and replacements orderly.
- Standardize protocol and assignment configuration across the group.
Verify
Section titled “Verify”The group reaches and remains in a stable state, rebalance rate returns to baseline, all partitions are assigned once, processing resumes, and lag recovers.
Prevent Recurrence
Section titled “Prevent Recurrence”Expose poll/rebalance callback latency, failed rebalance count, last rebalance age, process restart count, and coordinator request latency. Roll out group configuration changes compatibly.