I read through a writeup of the Chandra–Toueg algorithm (1996) and wrote this note. It stays at the intuition level; the original covers the message-passing details.
The problem, stripped down
Five friends trying to pick one restaurant over a group chat. People drop offline mid-conversation, messages arrive late, and nobody can tell whether someone is just slow or is gone. The group still has to end up at exactly one restaurant.
That's the consensus problem: a group of computers, some of which can crash, must all agree on one value, and keep running to tell about it.
Why agreement is hard: FLP
The famous Fischer–Lynch–Paterson impossibility result: in a purely asynchronous system where even one process can crash, there is no algorithm that is guaranteed to reach agreement and always finish.
The intuition: in a group chat, if one person goes silent, you can't tell whether they crashed or are just lagging. If you wait for them, you might wait forever (they crashed). If you give up, they might have been about to send the deciding vote. There's no perfect move, and that's the point.
The cheat: a failure detector
We don't try to answer "dead or slow?" inside the agreement logic. Instead we hand that messy job to a separate gadget called a failure detector. Each computer asks it "who do you suspect is down?" and gets back a list.
The version Chandra–Toueg needs is called ◊S ("eventually strong"). It has two carefully limited guarantees:
- Strong completeness — a truly crashed computer is eventually suspected by everyone.
- Eventual weak accuracy — eventually at least one live computer stops being wrongly suspected.
In practice you implement ◊S with timeouts: if you haven't heard a heartbeat in a while, you suspect.
Majority overlap
Any two groups that each contain more than half the nodes must share at least one member. That shared member is how a decision survives from one round to the next.
The rotating chairperson
The algorithm runs in numbered rounds, and each round has one pre-assigned coordinator (the chairperson), chosen round-robin. The chairperson's job:
- Collect everyone's current vote and a timestamp of how recently each was updated.
- Wait to hear from a majority, then propose the vote with the most recent timestamp.
- Nodes reply with ACK, or say they suspect the chairperson and bail out of the round.
- If a majority ACKs, the value is locked and the chairperson shouts DECIDE. Otherwise, rotate to the next round.
"Freshest value wins"
If a value was ever locked by a majority, the freshest timestamp is carried with it, so every later chairperson is forced to re-propose the same value. Combined with the guaranteed overlap, two conflicting decisions are impossible. Paxos does the same thing with "highest-numbered accepted proposal."
Why it eventually finishes
Termination needs both ◊S guarantees: completeness means a crashed chairperson is eventually suspected, so rounds don't hang. Weak accuracy means the rotation eventually lands on a live chairperson nobody wrongly suspects, and that round finishes.
The family resemblance: Paxos and Raft
Chandra–Toueg, Paxos and Raft are different clothes over the same machinery — proposers, majority, freshest value wins; leader, quorum, term/log comparison. Raft's election timeout is a failure detector, in the crudest and most practical form.
One sentence
Chandra–Toueg reaches agreement among crash-prone computers by bolting on a "maybe they're dead" detector and a rotating chairperson, while majority quorums make agreement unconditional.