◄ WORLD V · SONNY 5DART 215 · a helldive at the net

THE RAFT CONSENSUS consensus you can actually understand

Raft makes a cluster agree on a replicated log by electing one leader per term. A candidate wins only with votes from a majority⌊N/2⌋+1 — which guarantees no two leaders in the same term (any two majorities overlap in at least one node). The leader appends entries and an entry commits once it is replicated on a majority. Majority everywhere is the whole trick: it makes split-brain arithmetically impossible.

THE TECHNIQUE majority = ⌊N/2⌋+1 ; elect on majority votes, commit on majority replicas

Pick a cluster size and watch the majority threshold decide everything — a candidate with a majority of votes becomes leader, an entry on a majority of nodes commits, and anything short of a majority does neither: live demo


HISTORY & CREDIT Ongaro & Ousterhout, 2014

“Distributed consensus is inherently too subtle to follow.” — that reputation belonged to Paxos. Raft was designed for understandability: separate leader election, log replication, and safety into parts a person can hold in their head, and lean on one idea — the majority quorum — for correctness. cited

1998 · Leslie Lamport — Paxos (“The Part-Time Parliament”): correct, foundational, famously hard to teach.
2014 · Diego Ongaro & John Ousterhout — Raft (“In Search of an Understandable Consensus Algorithm”): same safety, built to be taught; strong leader + majority quorums.
now · etcd, Consul, TiKV, CockroachDB — the control plane of modern infrastructure runs on Raft.

Why a majority and not just “enough”? Because any two majorities of the same set must share a member, and that shared node refuses to vote twice or hold two truths — so two conflicting decisions can never both stand. Consensus falls out of set arithmetic. Raft 2014

RECOMMEND FOR I-13 majority gates election and commit, computed

On the canonical compiler, for N=5 the majority is 3: three votes elect a leader, three replicas commit an entry, and two of either does neither:

$ i13 run raft.i13 # N=5 majority = 3 -- floor(5/2)+1 elected = 1 -- 3 votes >= 3 committed = 1 -- entry on 3 nodes >= 3 with2 = 0 -- 2 is NOT a majority: no election, no commit
Recommend: Raft is LIT for I-13 — verified the majority of 5 is 3, that 3 votes elect and 3 replicas commit, while 2 does neither. The safety proof is just the overlap of majorities, and it reduces to integer comparison — the cleanest possible statement of “no split brain.”