On this page
Kafka Improvement Proposal
KIP-853: change the KRaft controller quorum without downtime
KIP-853 made the set of KRaft controllers changeable while the cluster runs. Before it, the voters were fixed in every node's configuration, so replacing a controller machine meant reconfiguring and restarting the whole quorum. With a dynamic quorum you add or remove a controller with one command.
- Proposal
- KIP-853, KRaft Controller Membership Changes
- Status
- Shipped Dynamic quorums since Kafka 3.9 (2024); upgrading a static quorum since 4.1.
- Area
- Cluster and operations
- Proposal page
- KIP-853 on the Apache Kafka wiki
Why it was needed
The first KRaft releases took the controller list from controller.quorum.voters, identical on every node. Losing a controller disk, moving to new hardware or growing from three to five controllers all required a carefully ordered restart of every node, the kind of operation that causes outages.
What it changes
The voter set is now stored in the metadata log itself, as a record the quorum agrees on like any other change. Each controller is identified by its node id plus a directory id, so a wiped disk is recognised as a new replica. Nodes find the quorum through controller.quorum.bootstrap.servers instead of a fixed voter list.
How to use it
- Format new clusters with kafka-storage.sh format --standalone, --initial-controllers or --no-initial-controllers to get a dynamic quorum.
- Add or remove controllers with kafka-metadata-quorum.sh add-controller and remove-controller.
- Upgrade an existing static quorum on Kafka 4.1 or later by enabling kraft.version=1, then replace controller.quorum.voters with controller.quorum.bootstrap.servers.
Where it stands
Shipped in Kafka 3.9 for new clusters; converting a static quorum became possible in Kafka 4.1. Kafka 4.2 added automatic joining of new controllers, and Kafka 4.4 added unregistering controllers (KIP-1312).
What comes next
Work continues on operating the quorum, for example changing dynamic configs on controllers (Kafka 4.3). The static controller.quorum.voters setting is deprecated.
See it in the simulator
- Kafka KRaft dynamic quorum: add and remove controllers (Dynamic quorum: replace a lost controller) Step 4: c3 joins as an observer Open at this step: Kafka KRaft dynamic quorum: add and remove controllers
- Kafka KRaft dynamic quorum: add and remove controllers (Dynamic quorum: replace a lost controller) Step 7: c3 is a voter: 4 voters, majority 3 Open at this step: Kafka KRaft dynamic quorum: add and remove controllers
- Kafka KRaft dynamic quorum: add and remove controllers (Dynamic quorum: replace a lost controller) Step 9: Remove dead c2: 3 voters, majority 2 Open at this step: Kafka KRaft dynamic quorum: add and remove controllers
- Kafka KRaft quorum: losing a majority of controllers (KRaft quorum) Step 2: Standby c2 killed - 2 of 3 voters, majority holds, c0 active Open at this step: Kafka KRaft quorum: losing a majority of controllers
- Kafka KRaft quorum: losing a majority of controllers (KRaft quorum) Step 7: Voter c1 restored - majority back, frozen election completes Open at this step: Kafka KRaft quorum: losing a majority of controllers
The simulator treats every KRaft quorum as dynamic and commits a voter change at once; it does not model directory ids, which Kafka uses with the node id to name a voter.
Sources
- KIP-853: KRaft Controller Membership Changes
- Apache Kafka 4.4: KRaft operations
- Apache Kafka 3.9.0 release announcement