Consensus Algorithms · Phase 3

Replication

Article 3.3 of 4

Jul 10, 2026 · devops · 19 min read · 4000 words intermediate

Quorums and majority voting.

devops distributed-systems quorums series-consensus

This article proves, properly, the single mathematical fact that every consensus algorithm in this series is built on top of — the fact articles 1.2 and 3.2 have been previewing informally for two phases now: any two majorities of the same set of nodes must share at least one common member. That one-sentence guarantee is the entire mechanism preventing split-brain, and it's why "get a majority to agree" is such a recurring, load-bearing pattern throughout this series. This article gives it a full formal treatment, generalizes beyond simple majorities to arbitrary read/write quorum configurations, and covers witness nodes — a genuinely clever trick for getting quorum's safety properties without paying for a full extra replica.

The overlap proof, properly

Take a cluster of N nodes. A majority quorum is any subset of at least ⌊N/2⌋ + 1 nodes (for N=5, that's 3; for N=7, that's 4). The claim: any two majority quorums, Q1 and Q2, drawn from the same set of N nodes, must intersect — share at least one node in common.

The proof, in full, is genuinely this short: suppose Q1 and Q2 were completely disjoint (no shared members). Then |Q1| + |Q2| ≤ N (their combined size can't exceed the total node count, since they don't overlap). But both are majorities, so |Q1| ≥ ⌊N/2⌋+1 and |Q2| ≥ ⌊N/2⌋+1, meaning |Q1|+|Q2| ≥ 2(⌊N/2⌋+1) > N for any N. This directly contradicts |Q1|+|Q2| ≤ N — so the assumption (disjoint majorities) must be false. Two majorities of the same set always overlap. QED.

Concretely, for N=5: any two groups of 3 nodes drawn from the same 5 must share at least one node, because 3+3=6 > 5. There is no way to partition 5 nodes into two disjoint groups that are both size 3 or larger — arithmetic simply forbids it. This is the entire mathematical content behind the informal claim in articles 1.2 and 3.2 that "split-brain becomes impossible if both sides need a majority" — it isn't a heuristic or a design convention, it's a guaranteed consequence of counting.

Why two majorities of 5 nodes can never be disjoint 1 2 3 4 5 Q1 = {1,2,3} Q2 = {3,4,5} node 3 is forced into both — the overlap Try to build two disjoint 3-node groups from only 5 nodes: impossible, 3+3=6 > 5.

Fig 1 — Node 3 is the forced overlap; no arrangement of two majority-sized groups from 5 total nodes can avoid sharing at least one member.

Why this single fact does all the safety work

Trace the consequence through the mechanisms previewed across the last two phases: if a write is only considered committed once a majority of replicas durably have it (article 3.2's precise definition of "committed"), and any future majority (needed, for instance, to elect a new leader or to read the current value with certainty) is guaranteed to overlap with that original writing majority by at least one node — then that overlapping node is guaranteed to know about the committed write, and can make sure it isn't lost or contradicted. This is the exact mechanism that makes split-brain (articles 1.1, 1.2) structurally impossible rather than merely unlikely: two sides of a partition can never both simultaneously hold a majority, because that would require two disjoint majorities of the same node set — which the proof above shows cannot exist.

Applying overlap to leader election specifically

This is worth making fully concrete, because it's the mechanism Phase 5's algorithms lean on most heavily. Suppose leader L1 (elected during term 2, using majority Q1) commits a write, then is suspected dead and a new leader L2 is elected (during term 3, using majority Q2, gathered via the election process covered abstractly in article 4.2). Because Q1 and Q2 must overlap, at least one node that voted for L2 also has L1's committed write. A well-designed election protocol (Raft's, specifically, in Phase 5.5) requires each voting node to only vote for a candidate whose log is at least as up-to-date as its own — meaning the overlapping node, which has the committed write, will refuse to vote for any candidate that doesn't also have it, which in turn guarantees the newly elected leader L2 must itself already have that committed entry. The committed write survives the leadership change, automatically, purely as a consequence of the overlap guarantee plus a simple voting rule — no separate "sync the new leader's log" step is needed before it can safely start serving.

Beyond simple majorities: generalized quorums

Majority quorums (more than half) are the most common configuration, but the underlying overlap requirement can be satisfied more flexibly. The general rule for a system using separate write quorums (W nodes must confirm a write) and read quorums (R nodes must be consulted for a read) to guarantee that every read sees every prior write is:

W + R > N (a simple majority quorum is the special case W = R = ⌊N/2⌋+1, which trivially satisfies W+R > N)

This is exactly the generalized quorum condition Dynamo-style systems (article 1.2's leaderless replication row) use, and it's a genuinely useful extra degree of freedom: a system can choose W and R independently, as long as their sum exceeds N, trading off write latency against read latency based on the actual workload. A read-heavy workload might choose a small R (fast reads, consult few replicas) paired with a large W (writes must reach almost everyone, slower but ensures reads stay small and fast) — or the reverse for a write-heavy workload. This flexibility is exactly the tunable-consistency knob referenced in article 1.4's PACELC discussion (Cassandra's ONE/QUORUM/ALL consistency levels are a direct, real-world instance of choosing points on this W+R>N trade-off).

ConfigurationWRTrade-off
Simple majority (N=5)33Balanced — the default, safe, unremarkable choice
Read-optimized (N=5)51Every write must reach ALL replicas (slow writes), any single replica read is safe (fast reads)
Write-optimized (N=5)15Any single replica accepts writes (fast writes), reads must consult ALL replicas (slow reads)
Below threshold (N=5)22W+R=4 ≤ N=5 — no overlap guarantee, this is a deliberately weaker/eventually-consistent configuration, not a safe quorum
The bottom table row is a real, common production misconfiguration to watch for. Choosing W and R such that W+R ≤ N is a legitimate choice if made deliberately — it trades the strong-consistency overlap guarantee for lower latency, moving toward the eventual-consistency end of article 1.4's PACELC spectrum. The danger is when it happens accidentally, from a misunderstanding of the arithmetic (e.g., assuming any "quorum" name in a config file automatically implies the overlap guarantee, when the actual configured numbers don't satisfy W+R>N) — always verify the actual numbers, not just the label.

Witness nodes: quorum votes without full replicas

A genuinely clever refinement worth knowing: a witness node (sometimes called an "arbiter" or "quorum witness," depending on the system) participates in quorum voting — it can vote in leader elections and count toward the majority needed to commit — without storing the actual replicated data or log entries. It exists purely to tip the numerical balance of a cluster, which is valuable in a specific, common scenario: a cluster that would otherwise need an even number of full data-bearing replicas (say, 2 full replicas across 2 datacenters, which as article 1.2's aside on odd cluster sizing notes, gives you zero fault tolerance if either side needs a majority) can instead deploy 2 full replicas plus 1 lightweight witness in a third location, getting proper odd-numbered majority arithmetic (any 2 of 3 is a majority) without paying for a third full copy of potentially large replicated state.

Real-world use case: a two-datacenter deployment where a third full datacenter isn't justified by cost, but the cluster still needs proper majority arithmetic to avoid the "2 nodes, either alone is a tie, neither can safely proceed" problem. A witness node — often just a small, cheap VM running minimal software, sometimes even in a third cloud region purely for this purpose — resolves the tie-breaking arithmetic cheaply. Several production systems covered in Phase 8/9 (including some etcd and SQL Server-family deployments) use exactly this pattern in practice.

FAQ

Does the overlap guarantee still hold if the cluster size changes (nodes added or removed)?

The proof holds for any fixed N at the moment it's evaluated, but changing cluster membership mid-operation is exactly the tricky case that needs its own careful protocol — naively swapping from one N to another can create a window where old and new majorities don't necessarily overlap. This is precisely why dynamic membership changes (previewed in the CLAUDE.md-listed topics, covered fully in Phase 9.6) need dedicated algorithms like joint consensus, rather than just "update the node count and continue."

Why not always use W=N (require every single node to confirm every write) for maximum safety?

Because it destroys availability — a single node failure would make the entire system unable to accept any writes at all, which is a far worse trade-off than what majority quorums offer (tolerate up to ⌊(N-1)/2⌋ failures while remaining fully available). W=N also directly reintroduces the "wait for the slowest/most distant node" latency cost discussed in article 1.4's PACELC treatment, for every single write, with no benefit over a majority once you already have the overlap guarantee.

Can a witness node ever become a safety liability instead of just a tie-breaker?

Only if it's treated as more than what it is — since it doesn't hold the actual data, it can vote toward quorum but can never actually serve reads or help a badly-behind replica catch up (it has nothing to serve). Systems using witness nodes are careful to ensure enough data-bearing replicas remain in any majority to actually preserve the data, not just the vote count — a witness contributes to quorum arithmetic, not to data durability.

Is the majority requirement the same thing as "2 out of 3" being the universal minimum production cluster size?

3 is the smallest cluster size that tolerates any failure at all while still using majority quorums (a majority of 3 is 2, so it tolerates 1 failure) — smaller clusters (1 or 2 nodes) either have no fault tolerance or, for 2 nodes, no valid majority concept at all (a "majority" of 2 would need to be both nodes, i.e., W=N, with the availability problem noted above). This is exactly why 3 is the conventional practical minimum for anything calling itself fault-tolerant, echoing article 1.2's odd-sizing discussion.

Takeaways

  • The core proof: any two majority quorums of the same node set must overlap, because |Q1|+|Q2| > N whenever both exceed N/2 — a direct arithmetic consequence, not a design convention.
  • This overlap guarantee is the entire mechanism preventing split-brain: two disjoint majorities accepting conflicting writes is mathematically impossible, not just unlikely.
  • Applied to leader election specifically: any newly-elected leader's voting majority is guaranteed to overlap with any prior committing majority, which (combined with a simple "vote only for an up-to-date candidate" rule) guarantees committed writes survive leadership changes automatically.
  • The generalized condition W + R > N extends beyond simple majorities, letting systems (Dynamo-style, Cassandra) independently tune read and write quorum sizes for latency trade-offs — while W+R ≤ N is a real, common accidental misconfiguration that silently drops the overlap guarantee.
  • Witness nodes participate in quorum vote-counting without storing data, a genuinely useful trick for fixing even-numbered cluster arithmetic (e.g., 2 datacenters) without paying for a full extra data-bearing replica.

References & further reading

← 3.2 Log Replication next: 3.4 Leases and Linearizable Reads →
© cvam — written in plaintext, served warm