Distributed systemssplit-braindual primarytwo leaders

Split brain

Definition

Split brain is the state in which a cluster has more than one active leader or primary at the same time, each accepting writes that the other does not see.

In practice

It typically happens when failover relies on timeouts: the old primary is only unreachable, not dead, so it keeps serving clients while a replica is promoted. The two histories diverge, and reconciling them later means discarding or manually merging confirmed writes.

Prevention is about making a second leader unable to act, not just unlikely. Require a majority (quorum) to elect a leader, so at most one side of a partition can win, and fence the old leader with tokens, leases or STONITH. A two-node cluster cannot tell a dead peer from a partition, which is why a third voter or witness is added.

Example

A network blip isolates the primary for 40 seconds; the replica is promoted after a 30-second timeout, and both nodes accept orders for 10 seconds until the old primary is fenced, leaving 120 orders to reconcile.