raft-kv · simulator traces
Watch a Raft cluster agree
raft-kv implements Raft from scratch in Rust and runs it in a deterministic simulator: the same run happens every time. Raft lets a group of machines agree on one order of events even while some of them crash. One machine leads, every change is copied into every log, and a change counts only once more than half the group has stored it.
This page replays four recorded runs from the simulator: an election, a write, a leader failure, and a network split. Times are simulated milliseconds, not wall-clock.
initial state
Each row is one node: a machine running this program. The boxes are the entries in its log, in order. A grey box is written down but not yet decided; a green border means committed, more than half the nodes have stored it; a filled green box means this node has applied it to its own data. Term is the round number, which goes up with each election, and the role word sits at the left of the row.
In these traces, stop and restart keep a node's memory, so a restarted node only fetches what it missed. Recovery from a real crash, from disk, is covered by the process-level tests in the repository.