Rebalancing protocols decide how partitions are revoked and reassigned.
Eager rebalance (classic "stop the world")
- On rebalance, consumers typically revoke all assigned partitions first.
- Then the group gets a brand-new assignment.
- Simple mentally, but causes a full pause in processing for the group.
- More stop-the-world latency during membership changes.
Eager: all partitions revoked → new assignment computed → all re-assigned
Cooperative rebalance (incremental)
- Only the partitions that must move are revoked.
- Consumers can keep working on partitions they still own.
- Rebalances happen in increments, reducing downtime.
- Used with cooperative sticky assignors (e.g.
CooperativeStickyAssignor).
Cooperative: only P2 needs to move from C1 → C2 C1 keeps P0,P1 while P2 transfers
Why interviewers like this
It shows you know not only that rebalances exist, but that protocol choice affects availability during scaling and rolling deploys.
Practical takeaway
Prefer cooperative sticky assignment for large groups / frequent membership changes, unless you have a reason to stay on an older eager setup.
Interview tip: "Eager = revoke everything; cooperative = revoke only what must move. Cooperative reduces rebalance pause."