How it works
Terms and heartbeats
Nodes attach a monotonically increasing term to leadership and use heartbeats or leases to detect when the current leader is no longer healthy.
Majority agreement
Consensus protocols require a majority vote so two isolated minorities cannot both elect authoritative leaders.
Fencing stale leaders
Fencing tokens let downstream resources reject commands from an old leader that wakes after its lease has expired.
Design tradeoff
Faster failure detection shortens failover but raises the chance of unnecessary elections during brief network delays.