Monedula
Kafka guide contents

Markdown

Part VI · Reference

Kafka Improvement Proposal

KIP-595: Raft for the Kafka metadata quorum

Cluster and operations · Shipped · since Kafka 3.3 · status checked November 2026

KIP-595 is the consensus protocol inside KRaft. The controllers elect one leader by majority vote, the leader appends metadata records to a log, and a record counts as committed once a majority has it. It is Raft, adapted to Kafka: followers pull the log with fetch requests, just as follower replicas do for topic partitions.

Proposal
KIP-595, A Raft Protocol for the Metadata Quorum
Status
Shipped Shipped with KRaft; production-ready since Kafka 3.3.
Area
Cluster and operations
Active c0 dies; c1 elected. The active controller c0 is killed before the standbys replicated offset 4. c1 is elected and the controller EPOCH bumps 0→1 (a new term). The simulator shows c1 at 3, behind c0's 4, and holds it in a catch-up window before it serves. In KRaft c1 already has every committed record: offset 4 was only on c0, so it was never committed, and c0 truncates it when it rejoins. Open this step in the full playground

Why it was needed

Replacing ZooKeeper (KIP-500) needed a way for several controllers to agree on one ordered history of metadata changes and to survive the loss of a minority of them. Kafka already had a replicated log, but its leader election depended on a controller, which is exactly what was being built. The quorum needed to elect its own leader.

What it changes

Each controller is a voter. When the leader stops sending, a voter raises the epoch and asks for votes; it wins only with a majority and only if its log is at least as up to date as each voter that grants a vote. The leader appends records, followers fetch them, and the high watermark moves when a majority has the record. A voter that was down catches up by fetching, or by loading a snapshot if it is far behind.

Where it stands

Implemented as the core of KRaft. It has run production clusters since Kafka 3.3 and is the only metadata mode since Kafka 4.0. The voter set was static at first; KIP-853 in Kafka 3.9 made it changeable at runtime.

What comes next

Stable. Improvements arrive as smaller KIPs on top: changing the voter set at runtime (KIP-853), automatic joining of new controllers in Kafka 4.2, and unregistering controllers in Kafka 4.4 (KIP-1312).

See it in the simulator

Sources

All Kafka KIPs