liveBook · Manning

StickyAssignor

As explained in Apache Kafka in Action

The Sticky Assignor is a Kafka partition-assignment algorithm that preserves as many existing partition assignments as possible during rebalancing.

StickyAssignor is a Kafka partition-assignment algorithm that preserves as many existing assignments as possible during rebalancing. It avoids recalculating the entire assignment while retaining the even-distribution behavior associated with Round Robin. section 9.4.2

A consumer failure

When Consumer 1 fails, a Round Robin reassignment can give every consumer entirely different partitions, forcing internal caches to clear and offsets to be committed. StickyAssignor minimizes those changes, but all consumers still stop consuming during the rebalance. section 9.4.2

Figure 9.7 The Cooperative Sticky Assignor avoids stopping the world and rebalances by replacing a single rebalance by two consecutive ones. During the first rebalance, consumers are asked to let go of the partitions that should be moved to another consumer; in the second rebalance, the now dangling partitions are assigned to the consumers.
A screenshot of a computer game

AI-generated content may be incorrect.

Compare StickyAssignor with Cooperative Sticky Assignor: the cooperative protocol replaces one full stop with two rebalances, allowing unchanged partitions to continue consuming. section 9.4.2

How Apache Kafka in Action covers it

How deep it goes
Explains assignment stability and stop-the-world rebalancing, then contrasts the approach with its cooperative successor.
Examples
Uses a failed consumer, changed partition ownership, internal caches, committed offsets, and a three-partition group joining a new consumer.
What you can do after
Evaluate whether minimizing partition movement is preferable to full reassignment despite continued consumption pauses during rebalancing.
How it connects
Connects partition assignment with Round Robin Assignor, Cooperative Sticky Assignor, consumer groups, and rebalancing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Apache Kafka in Action. The section links point to the parts of the book it draws on.