Scenario 08.0.2 · Network partition: split-brain
Kafka split-brain: what a network partition does to leaders
A network split cuts the leader off from the controller. The controller fences it and elects a new leader from the reachable ISR, so the isolated old leader can no longer commit writes - no split-brain.
Run this scenario in the playgroundHealthy cluster. t+1.000s
Three brokers, RF=3, min.ISR=2. broker-1 leads; the network is whole.
Open at this step: step 1, Healthy clusterO1,O2 committed. t+5.000s
O1,O2 commit on all three replicas (HW=2).
Open at this step: step 2, O1,O2 committedSplit: isolated leader is fenced. t+9.000s
The network splits into {broker-1} and {broker-2, broker-3}. broker-1 was the leader but can no longer reach the controller quorum, so the controller fences it and elects broker-2 from the ISR (epoch→1). broker-1 cannot commit acks=all writes without its followers; the simulator shows it serving nothing at all.
Open at this step: step 3, Split: isolated leader is fencedHealed. t+13.000s
The link is restored. broker-1 rejoins as a follower under leader broker-2 and re-enters the ISR. Because only one side ever had a leader, there is nothing to reconcile.
Open at this step: step 4, HealedWhat you start with
A network partition is subtler than a crash - no broker dies, but the cluster is cut into groups that cannot see each other. Kafka prevents split-brain through the controller, not a majority of replicas: the KRaft controller fences a broker it can no longer hear from and elects the new leader from the live ISR, bumping the leader epoch. Here the split cuts the old leader off from the controller, and you watch leadership move to the side that can still reach it.
Step by step
- Healthy cluster t+1.000s Three brokers, RF=3, min.ISR=2. broker-1 leads; the network is whole. Open at this step: step 1, Healthy cluster
- O1,O2 committed t+5.000s O1,O2 commit on all three replicas (HW=2). Open at this step: step 2, O1,O2 committed
- Split: isolated leader is fenced t+9.000s The network splits into {broker-1} and {broker-2, broker-3}. broker-1 was the leader but can no longer reach the controller quorum, so the controller fences it and elects broker-2 from the ISR (epoch→1). broker-1 cannot commit acks=all writes without its followers; the simulator shows it serving nothing at all. Open at this step: step 3, Split: isolated leader is fenced
- Healed t+13.000s The link is restored. broker-1 rejoins as a follower under leader broker-2 and re-enters the ISR. Because only one side ever had a leader, there is nothing to reconcile. Open at this step: step 4, Healed
The takeaway
Only one leader can commit after a split because the controller elects from the ISR it can reach and bumps the leader epoch; the isolated old leader cannot advance its high watermark, and anything it took with acks=1 is truncated when it rejoins.
Configs in this scenario
-
min.The fewest in-sync replicas, leader included, that must have a write for an acks=all produce to succeed (default 1); with fewer in the ISR the leader rejects the write with NOT_ENOUGH_REPLICAS. How min.insync.replicas worksinsync. replicas -
acksHow many replicas must have a write before the producer counts it as sent: 0 (none), 1 (the leader only) or all (every in-sync replica, the default, and required for idempotence). How acks works
Embed this scenario
Paste this into a blog post, a course page or your team's docs. The scenario plays inside your page, and the link under it points readers to this walkthrough.
<iframe src="https://monedula.dev/kafka-simulator/embed/?scenario=08.0.2" title="Kafka Simulator: Network partition: split-brain" width="100%" height="520" style="border:1px solid #d0d0d0;border-radius:8px" loading="lazy"></iframe>
<p><a href="https://monedula.dev/kafka-simulator/scenarios/network-partition-split-brain/">Kafka split-brain: what a network partition does to leaders</a></p>