>_

Consensus / Raft

Watch leader election, log replication, and quorum as nodes join, crash, and recover.

Term

1

Leader

N0

Quorum

3

Committed

0

Leader Follower Down
N0leader · log 0N1follower · log 0N2follower · log 0N3follower · log 0N4follower · log 0
Committed log
none yet

All nodes up. Quorum needs 3 of 5. With no leader, auto-append does nothing and committed entries stop growing until you Elect a new leader.

How this simulator works

One node is the leader and replicates its log to followers. An entry is committed only once a majority of the cluster holds it. Kill the leader or drop below a quorum and writes stall.

Leader election

  • A candidate becomes leader only with votes from a majority of the whole cluster.
  • Fewer than a majority of nodes alive → no election can succeed, so there is no leader.
  • Crash the leader and the group must elect a new one before writes resume.

Quorum and commit

  • Quorum = floor(N/2) + 1. With 5 nodes that is 3.
  • An entry is committed once a majority of nodes have replicated it — then it is safe.
  • If a minority holds the latest entry, it is NOT committed and can be overwritten.