Distributed systems Simulation Intermediate 3D dissection 52 components 17 Oct 2026

Anatomy of Raft

In Search of an Understandable Consensus Algorithm, dissected: five servers laid out in 3D with their terms, votes, logs and state machines, Figures 7 and 8 rebuilt from real blocks, and a research desk that reruns the paper's leader-election measurements.

A complete, granular dissection of Ongaro and Ousterhout (2014). Five servers lie on a 3D table as rows, the way the paper draws its logs: each has its state, its election timer, its log, its state machine and, on a leader, nextIndex and matchIndex, with messages as links that draw on. A seeded run elects a leader, replicates and commits commands, crashes the leader holding an unsent entry, elects another, repairs the old leader's log and heals a cut-off follower. The paper's Figure 7 (six follower logs) and Figure 8 (why old terms are not counted) are rebuilt from real blocks and run through the engine, the five properties of Figure 3 are checked on 300 random executions, and joint consensus is enumerated exhaustively. A 28-step article cites every number to its sentence, notes where the paper contradicts itself, and ends with a research desk of three pre-registered experiments: Figure 16 reproduced, the dissertation's closed-form split-vote model checked against simulation, and where the timing requirement breaks.

The machine

Five servers as rows on a table. Along each row: state (role, term, vote, commit, applied), the election timer as a strip that fills, the log (one cell per entry, height and colour from its term), the state machine (three registers) and, on a leader, nextIndex and matchIndex. Messages are links that draw on between rows, coloured by type. Up the table: the terms of the run, Figure 7's seven logs with the leader repairing them, Figure 8's five panels, the snapshot rules, the membership enumeration and the research results as blocks.

What is real. The run is a seeded discrete-event simulation of the rules of the paper's Figure 2, computed in the page by engine.js. test.mjs checks it against Figure 7 (rejections per follower counted by a separate walk down the logs), Figure 8 (panels d and e recomputed), the five properties of Figure 3 on 300 random executions with crashes, partitions, loss and duplication, two deliberately broken rules, the dissertation's closed form against the numbers its text quotes, an exhaustive enumeration of configuration changes against a pigeonhole condition, and the stored research results recomputed from their seeds. Every paper number is a fact with a verbatim quote from the paper, the dissertation or the source code.

What to take away

  • A leader may commit by counting replicas only for entries of its own term; counting an old-term entry, as in Figure 8, loses a committed entry, and the checker shows it.
  • Split votes follow a closed form: the dissertation's formula matched the simulation in all 21 cells of the grid, and 10 times the latency keeps a five-server cluster under 40% split votes.
  • Where the paper's 15 ms of broadcast time sits, in the network or in the disk, changes election times by an order of magnitude in the same simulation.
  • The timing rule is about the tail of the latency, not its mean: with the same 4 ms mean, 150 ms timeouts give no spurious elections at one tail and several per hour at a heavier one.
  • A change of one server at a time can never elect two leaders, which is why the dissertation retreats from joint consensus.

Sources

More machines

Other working models

The whole gallery →