Distributed Systems · Agreeing and coordinating
Consensus and leader election (Raft)
Consensus gets a group of machines to agree on one leader and one order of changes. Raft does it with numbered terms, random election timers and majority votes, so a cut-off minority can never commit.
- Time30 min
- LevelSenior
- Experiments1 live
- Check6 questions







Leader crashes heartbeats from A stop; B and C hear nothing.
Candidate B starts term 2, votes for itself and sends RequestVote.
Vote C has no vote yet in term 2, and B's log is current.
Leader two votes of three; B sends heartbeats for term 2 at once.
Commit index the newest entry known to be stored on a majority.