Skip to content
Kafka Is Fun

IntermediateInternals

What is the difference between sticky and cooperative sticky partition assignment?

Reference answer

Both are sticky assignors, but they differ in the rebalance protocol. The classic StickyAssignor was not made to support cooperative rebalancing and uses the eager protocol, in which a consumer must revoke all its owned partitions before participating in a rebalance. CooperativeStickyAssignor, introduced by KIP-429 (incremental cooperative rebalancing), allows a consumer to retain its currently owned partitions during a rebalance, so consumers that keep their partitions can continue processing while only the partitions that need to move change hands. The consumer default for partition.assignment.strategy is RangeAssignor followed by CooperativeStickyAssignor, so it uses Range (eager) until the list is changed. Kafka 4.0 also made the KIP-848 consumer protocol (group.protocol=consumer) generally available.

Expected key concepts: StickyAssignor, CooperativeStickyAssignor, eager, cooperative, KIP-429, revoke, retain, rebalance, partition.assignment.strategy, RangeAssignor

How did that feel?

Your own verdict, not the score. It shows up next to this question in the list, so you can come back to the shaky ones.