Monedula
Kafka guide contents

Markdown

Part VI · Reference

Kafka Improvement Proposal

KIP-345: static membership, restart a consumer without a rebalance

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

KIP-345 gives a consumer a fixed identity, group.instance.id. When a static member restarts within session.timeout.ms, it rejoins under the same identity and gets the same partitions back, with no rebalance for the rest of the group. Rolling restarts and short crashes stop shuffling partitions around.

Proposal
KIP-345, Introduce static membership protocol to reduce consumer rebalances
Status
Shipped Since Kafka 2.3 (2019), opt-in with group.instance.id.
Area
Consumer groups and queues
static member rejoins in time. s2 restarts with the SAME instance.id at t=2800 - within session.timeout.ms of its crash (1800 ms < 2000 ms here; timings are compressed, real brokers require at least 6 s) - so the coordinator’s held slot lets it resume p1 in place with NO rebalance (s1 still owns only p0). d2 is still absent, its eviction one tick away. Open this step in the full playground

Why it was needed

A normal consumer gets a new member id every time it starts. A restart therefore looks like one member leaving and another joining, which means two rebalances, and with eager rebalancing the whole group pauses twice. In a rolling deploy of 50 instances that is 100 rebalances, and local state such as Kafka Streams stores may be moved to another instance for no reason.

What it changes

A consumer configured with group.instance.id is a static member. It does not send a leave request when it shuts down, and the coordinator keeps its partitions reserved until session.timeout.ms runs out. If it comes back in time it simply takes them again. If it does not, it is removed and the group rebalances as usual.

How to use it

  • Give each consumer a stable, unique group.instance.id, for example the pod name of a StatefulSet.
  • Raise session.timeout.ms above the time a restart takes, so a deploy finishes inside the window.

Where it stands

Shipped in Kafka 2.3 and supported on both the classic and the KIP-848 consumer protocol. Two instances with the same group.instance.id fence each other, so the id must be unique per running process.

What comes next

Stable. With KIP-848 the broker handles static members natively, and Kafka 4.4 added static membership to the streams rebalance protocol (KIP-1071).

See it in the simulator

Sources

All Kafka KIPs