← Back to Labs

Leader election under failure

Watch heartbeats stop, a new quorum form, a fresh fence token appear, and the stale leader get rejected at the resource boundary.

Amsterdamleaderterm 42 · fresh heartbeattoken 42 validvote: self in term 42renews election recordFrankfurtfollowerterm 42 · 2.1s leftwatching token 42vote: Amsterdamhealthy quorum peerMilanfollowerterm 42 · 2.4s leftwatching token 42vote: Amsterdamhealthy quorum peerBrusselsfollowerterm 42 · 2.7s leftwatching token 42vote: Amsterdamslightly slower followerAthensfollowerterm 42 · 2.2s leftwatching token 42vote: Amsterdamhealthy quorum peerprotected shardowner Amsterdamactive token 42Lease row renewed before expiry.Protected shard accepts commands stamped with token 42.Heartbeatterm 42Heartbeatterm 42Renewtoken 42quorum5 voters, quorum size 3, leader is Amsterdam in term 42election ruleCoordinator record owner=Amsterdam, token=42, TTL is being renewed on schedule.safety stateOne live authority exists because quorum and the protected resource both still recognise token 42.
Step 1 / 6Stable leader renews authority

Amsterdam is the current leader in term 42. It is still receiving quorum acknowledgements and keeps the election record fresh, so every follower can safely treat Amsterdam as the only node allowed to act.

Quorum picture
5 voters, quorum size 3, leader is Amsterdam in term 42
Active fence
owner Amsterdam · token 42
Why this matters
One live authority exists because quorum and the protected resource both still recognise token 42.
Visible traffic
  • AmsterdamFrankfurt: Heartbeat (term 42)
  • AmsterdamMilan: Heartbeat (term 42)
  • AmsterdamProtected shard: Renew (token 42)

Arrow keys to navigate · R to reset

Tap dots to jump to any step

Read the full article →Take the quiz →