Monedula
Kafka guide contents

Markdown

Part VI · Reference

Kafka Improvement Proposal

KIP-54: the sticky assignor, move as few partitions as possible

Consumer groups and queues · Shipped · since Kafka 0.11 · status checked November 2026

KIP-54 added the StickyAssignor to Kafka consumers. When a group rebalances, it still aims for a balanced assignment, but it keeps every member on the partitions it already owns wherever it can, so as little as possible moves. The cooperative-sticky assignor of KIP-429 uses the same logic with incremental rebalancing.

Proposal
KIP-54, Sticky Partition Assignment Strategy
Status
Shipped Since Kafka 0.11 (2017); its logic lives on in CooperativeStickyAssignor (2.4).
Area
Consumer groups and queues
sticky - keeps the current layout (zero movement). Switching to sticky re-runs the assignment, but sticky is seeded with each member's CURRENT ownership and minimises movement - so it KEEPS the round-robin layout it inherited: c1 still owns p0 and p2, c2 still owns p1 and p3. Zero partitions move. That is sticky's whole point (see 02.2.2 / 02.2.4): unlike range/round-robin, which lay a fixed layout from scratch, sticky moves as few partitions as possible - here, none. Open this step in the full playground

Why it was needed

The range and round-robin assignors compute a fresh layout every time, ignoring who owned what. A single consumer joining could shuffle most partitions to new owners, throwing away caches and local state and causing more reprocessing than necessary.

What it changes

The leader of the group runs the assignor with the current ownership as input. The StickyAssignor balances the partition count first and then keeps as many existing assignments as it can. It still runs on the eager protocol, so every member revokes everything during the rebalance and gets most of it back; CooperativeStickyAssignor, added in 2.4, keeps the same layout but only revokes the partitions that actually move.

How to use it

  • Set partition.assignment.strategy=org.apache.kafka.clients.consumer.StickyAssignor, or better CooperativeStickyAssignor, on every member of the group.
  • With group.protocol=consumer (KIP-848) client-side assignors are not used; the broker assigns partitions.

Where it stands

Shipped in Kafka 0.11. Since Kafka 3.0 the consumer default is RangeAssignor followed by CooperativeStickyAssignor. The sticky idea also guides the broker-side assignors of the new consumer group protocol.

What comes next

Client-side assignors are on their way out for KafkaConsumer: KIP-1274 deprecates partition.assignment.strategy in Kafka 5.0 together with the classic protocol, and removes it in 6.0.

See it in the simulator

Sources

All Kafka KIPs