Consensus: keep agreement separate from progress
State a crash-fault consensus contract and explain why a reachable majority is a resource for a protocol rather than a complete correctness proof.
On this page
The question for today
What you’ll understand
- Distinguish agreement and validity from termination.
- Identify crash, storage, and communication assumptions in a consensus claim.
- Explain why a minority partition must not acknowledge independent committed histories.
An infrastructure controller needs one durable history of decisions: which model version is active, who owns a shard, or which configuration revision workers should use. Replicating the controller's memory does not automatically produce that history. Replicas can receive different messages and disagree about whether the leader is alive. Consensus supplies a disciplined decision protocol under a stated failure model. We begin with crash faults and delayed or lost messages, not malicious participants, and ask separately what must never happen and what conditions allow work to finish.
Give safety a concrete object
For one consensus instance, agreement means that two decisions cannot select different values. Validity constrains decisions to acceptable proposed values under the chosen specification; a server cannot invent an unrelated command. A replicated state machine extends the idea to indexed log positions, then applies the agreed commands in order. Two replicas can have different uncommitted suffixes temporarily. That is different from applying different committed commands at the same position, which violates the state-machine safety contract.
The fault model matters to every sentence in that contract. A crash-stop node stops taking steps; a crash-recovery node can return with specified durable information intact. Network messages may be delayed, duplicated, reordered, or lost, while the protocol authenticates identities and assumes participants follow its rules. Arbitrary forged votes, disk corruption presented as valid state, and malicious equivocation are outside ordinary crash-fault Paxos or Raft. Increasing a majority count does not silently convert these algorithms into Byzantine-fault-tolerant protocols.
Termination needs an environment that permits it
A safe protocol can stop making progress when too many replicas cannot communicate. In a fully asynchronous system, a long delay cannot be distinguished reliably from a stopped participant. Deterministic consensus cannot guarantee termination in every admissible asynchronous execution with a possible crash. Practical protocols therefore describe eventual communication and scheduling assumptions, stable leadership, randomized choices, or timing conditions for progress. A timeout is evidence for trying a new election, not proof that the old machine no longer executes.
With a fixed group and ordinary majority voting, tolerating f unavailable replicas while retaining a majority requires at least 2f+1 replicas. The surviving replicas must also be able to exchange and durably process the necessary messages. A count of powered-on machines is insufficient if the network splits them into mutually unreachable groups or their storage stops completing writes. Safety should survive arbitrarily slow messages within the fault model; an availability target additionally depends on the deployment's latency, repair, and failure behavior.
A client response is part of the contract
Define exactly what an acknowledgement promises. A response that only means the leader buffered a proposal is weaker than confirmation that a command was committed and applied with its result recorded. If a client times out, the command might have committed before the response was lost. Retrying without a stable request identity can execute an application action twice even when the log itself is perfectly agreed. The client protocol therefore needs deduplication or another explicit retry contract, not a slogan about consensus making everything exactly once.
Use the reliability lab to check the limited arithmetic. Choose Reset, explicitly set both replica count to five and unavailable count to two, predict the majority result, then Play or Step. For a separate comparison choose Reset again and explicitly set five and three. The first has three available replicas and the second two. The diagram does not know which replicas communicate, which entries they retain, or whether votes obey the protocol. A displayed majority is a necessary count for this design's progress, not a certificate that a decision is safe.
Work it through
A five-replica partition
A fixed five-voter cluster splits into connected groups {A,B,C} and {D,E}. Assume correct crash-fault protocol behavior and reliable communication within each group, but no communication across the split. What can the counts establish?
Compute the threshold: floor(5/2)+1=3 voters. The three-node group can potentially conduct a quorum operation, subject to leadership, log, and durable-state rules.
The two-node group has only two votes. It must not independently commit a conflicting command merely because its clients still reach it. An old leader in that group may not yet know a newer term exists.
If one node in the three-node group becomes unavailable, neither group has three communicating voters. Progress may stop while existing committed history remains protected. Healing the network can restore the conditions needed for a safe protocol to continue.
The partition permits at most one side to have the required majority. The actual safety argument still comes from persistent voting and log-selection invariants, while a majority alone does not ensure timely completion.
The living notebook
Explore the model
Interactive lab · reliability
Count a majority without inventing a protocol
For each separate comparison choose Reset, explicitly set both n and k, predict, then Play or Step. Compare (5,2) with Reset plus (5,3). The model counts available replicas only; it has no network partitions, elections, logs, durable votes, or consensus execution.
- Available replicas
- 4 of 5
- Majority needed
- 3
- Majority available?
- Yes
A replica count and a majority threshold, without a consensus protocol. Playback highlights fixed replica states. Having a majority alone does not establish linearizability, durability or failure independence. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forMajority availability is a count under assumptions. Agreement and eventual progress require additional protocol invariants and an environment that permits communication.
Pause & reason
Check your understanding
Your turn
Try it yourself
A service wants majority-based decisions despite three unavailable voters. What minimum group size meets the count requirement? If a write response is lost after commitment, does a retry automatically mean the first write did not happen?
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Use n≥2f+1, then distinguish an uncertain client observation from the server's committed state.
Compare with the solution
Seven voters give majority four, leaving four when three are unavailable. Those four must still communicate and satisfy protocol and storage requirements. A lost response leaves the client uncertain: the write may already be committed and applied. Reuse a stable operation identity under a defined deduplication contract or query the operation's outcome. Replaying a non-idempotent action as a fresh request can create a second agreed command rather than undoing the ambiguity.
Keep the idea
Take it with you
- Agreement and validity are safety claims; eventual completion is a separate liveness claim.
- Crash-fault consensus assumes correct participants and preserved durable state.
- Majority availability and client retry semantics each need explicit contracts.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.