liveBook · Manning

Eager rebalance

As explained in Kafka Streams in Action, Second Edition

Eager rebalancing is a Kafka consumer-group rebalance protocol in which all consumers revoke their existing partition assignments before new assignments are distributed.

Eager rebalancing is Kafka’s stop-the-world consumer-group protocol. When membership changes, every consumer gives up all assigned topic partitions, so processing pauses before new assignments are distributed. section 4.3.2

The protocol proceeds through these coordination steps:

  • The group coordinator detects membership change and triggers a rebalance. section 4.3.2
  • All members relinquish their partitions and send JoinGroup requests describing the partitions they want. section 4.3.2
  • The group leader creates assignments for every member and sends them to the coordinator in a SyncGroup request. section 4.3.2
  • Members receive assignments in SyncGroup responses and resume processing. section 4.3.2

A consumer joins

When a new consumer joins a group, existing consumers stop processing and surrender their partitions. After the leader recalculates assignments, most partitions may return to their original consumers, but all processing has paid the rebalance pause. section 4.3.2

Figure 4.13 Rebalancing with the eager or “stop-the-world” approach. Processing occurs on all partition stops until reassigned, but most of the partitions end up with the original consumer.
figure

Use the figure to visualize the full processing pause and the partitions that ultimately remain with their original consumers. section 4.3.2

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Details JoinGroup and SyncGroup coordination, but stops short of implementation code.
Examples
Uses a joining consumer and a figure showing partition reassignment with processing stopped.
What it assumes
Assumes consumer-group membership, topic partitions, and coordinator terminology.
What you can do after
Understand the request sequence and identify the processing downtime caused by eager reassignment.
How it connects
Connects consumer groups, topic partitions, group coordinators, group leaders, and cooperative rebalancing.

Related concepts

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