Monedula

Scenario 08.0.2 · Network partition: split-brain

Kafka split-brain: what a network partition does to leaders

Chaos · Intermediate · about 3 min · Apache Kafka 4.3

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 playground

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

What 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

  1. 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
  2. O1,O2 committed t+5.000s O1,O2 commit on all three replicas (HW=2). Open at this step: step 2, O1,O2 committed
  3. 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
  4. 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

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>

Further reading

Apache Kafka documentation

More in Chaos

All scenarios