↓Skip to main content
  1. Posts/
  2. Series/
  3. 🐫 Songs of the OCaml Compiler: The Series/

🐫 Addendum: Consensus & More

·· 6648 words· 27–45 min read

Paxos is used as a learning substrate Paxos is hard to understand and harder to implement right. This project keeps the scope to single-decree Paxos — narrow enough to be tractable (~2 weeks) and deterministic enough to verify cleanly. in this series. This addendum hosts my observations and intuitions on some core concepts revolving around this space that may help fast-track other learners. It also aims to funnel readers to actual canonical work that others have done.

Figure 1: šŸ™™ A caravan of young camels at the San Diego Zoo (retrieved) šŸ™›

Foundations #

Why Consensus Matters #

A decision made by a single machine is lost if that machine fails. Consider a system with multiple machines that collaborate across a network to make decisions and progress towards a goal. The machines may fail but the decisions that the system makes must survive that loss. That’s the key idea behind Distributed Consensus1.

Quorums Are About Intersecting-Sets #

For a cluster of nodes to make decisions, they would have to agree on the same truth. The set It’s ā€œsetā€ because the membership is what matters and not just the count. of participating nodes needed to decide on common truths is a quorum.

Any two sets that must not disagree with each other have to share a member, so if we don’t know which pairs (of sets) must not disagree, then it’s easier to make every pair overlap. That’s why a majority quorum rule is a convenient way to guarantee safety — that two quorums share at least one node so that the system does not forget a decision. Single-decree Paxos follows this instinct.

Imagine that a leaderless cluster of 5 nodes makes a decision and then one of the nodes has to discover what that decision was. Let’s hand-wave how this happens, just that "decided" For the example below, the entire caravan (with multiple caravan formations) makes a decision when enough parchments carry that information. No caravan formation can see ā€œenoughā€ parchments — it may only see what its own parchment says and dispatch couriers to get information from others. What is true of the system and what a participant observes may have a gap, that’s why we need to get intersecting sets. is a property of a set of durable records For the example below, the parchment that the caravan formations use is the durable record. Parchment is private and durable. For the example, writing the campsite on the parchment doesn’t mean that the caravan formation believes the group has agreed. Instead, it just means that this caravan formation will never write a different campsite. . Every node only knows its own state and none of the others. Though, it may send messages to the others to obtain that information.

To narrate Figure 2 , one of the caravan formations (e.g. A) has suggested to “camp @ the northern oasis”. Couriers from A ride out to all the others. We’ll call the set of formations that received the message and successfully wrote it to their own parchment, \(Q_{W}\).

  1. in Case A and Case B, a sandstorm happens and separates them into two groups \(\{A, B\}\) and \(\{C, D, E\}\). So the couriers don’t reach C, D and E to pass the message. Only A and B have written Yes, A will write on its own parchment paper. Implementation-wise, it’s easier to write code with common code-paths so we ā€œself-loopā€ and allow A to send a message to itself. "northern oasis" to their parchments. So \(Q_{W} = \{A, B\}\).

  2. in Case C, the sandstorm partitions the group differently. In addition to A and B, node C also manages to write the info to its parchment. The couriers don’t reach D and E. \(Q_{W} = \{A, B, C\}\)

Later, one of the formations wishes to know where the group is headed, so it asks everyone. \(Q_{A}\) is the set of nodes that respond.

The figure below is drawn from the Chronicler’s point-of-view (us readers / the simulator), no caravan formation (node) sees the entirety of the drawn panels in the diagram.

Figure 2: Quorums are about sets intersecting
Mapping definitions to the Tuareg canon
Table 1: Mapping Narrative Terms to the System Terms
Narrative term (canon)System term
Caravan formationparticipant / nodemember of a set
Parchmentprivate durable recordthe only place a decision persists
Courier on a dromedarymessagethe only way to learn information about another caravan
Collapsed messengernode unreachablewhy some caravans can’t be reached
Sandstormnetwork partitionwhy the reachable set changes over time
Chroniclerobserver outside the systemsees all five parchments; no caravan does
Table 2: Useful observations from Figure 2
CaseObservationHeuristicIntersection
A: No Guarantee — write set of 2, ask set of 3\(Q_{A} = \{ C, D, E\}\) and \(Q_{W}\) don’t overlap, the two legal sets miss each other. Under a rule of 3 responses, the asker stops the moment C, D and E answer. The asker gets a false-negative and is licensed to contradict a decision that has already happened. \(\lvert Q_{W}\rvert + \lvert Q_{A}\rvert = 2 + 3 = 5 \ngtr N\)If the sets merely failed to overlap and the system noticed, it would stall. That’s survivable because it would be a liveness problem. Actually, in this case, the asker won’t notice: it gets an honest, confident, wrong answer which risks creating a safety violation that can’t be recovered from.\(Q_{W} \cap Q_{A} = \emptyset\)
B: Asymmetric Case — overlap is forced from write set of 2, ask set of 4Under a rule of 4, \(B\) is in the ask-set. \(Q_{A} = \{ B, C, D, E\}\), so \(B\) wrote the campsite AND was asked. Group is heading to northern oasis. \(Q_{W}\) and \(Q_{A}\) are asymmetric, i.e. have different sizes. \(\lvert Q_{W}\rvert + \lvert Q_{A}\rvert = 2 + 4 = 6 \gt N\)The rule \(\lvert Q_{W}\rvert + \lvert Q_{A}\rvert \gt N\) guarantees overlap without either set being a majority.\(Q_{W} \cap Q_{A} = \{B\}\)
C: Majority Case — Overlap is guaranteed from write set of 3, ask set of 3Here, \(Q_{W}\) and \(Q_{A}\) have the same size (are symmetric) and for \(N\), the number of formations, \(\lvert Q_{W}\rvert + \lvert Q_{A}\rvert = 3 + 3 = 6 \gt N\) . By pigeonhole principle, there MUST be an intersecting node.If we use the majority rule, then we definitely have an answer. With a majority everywhere, no one needs to record which formations wrote anything. Any majority meets any other majority so this rule needs no book-keeping.\(Q_{W} \cap Q_{A}= \{C\}\)
My Takeaway 1: Quorums, regardless of the algorithm (Paxos, its variants, others…), are about a set of participating nodes, size being a mere property of that set.

When reading the original Paxos paperĀ 2, the narrative uses a quorum of parliamentarians and the ballots they cast. So, I was primed with the thinking that “quorum = enough votes to act”. The parliamentary setting actually has the counting-framing codified within a bookĀ 3. On further understanding, the protocol actually depends on more general point: a quorum is enough witnesses that no conflicting decision could have happened without at least one of them knowing about it.

The majority counting rule used in Paxos is a convenient and symmetric implementation of this intersecting-sets framing Every quorum used in the prepare (promise) phase must intersect every quorum used in the accept phase. .

I consider Takeaway 1 to be essential for learning Consensus Algorithms because it suggests that there are knobs within these formalised algorithms. Turning them can yield specialised variants of these algorithms for specific, practical use-cases. For example, the knob of relaxing the majority rule constraint is a stepping stone towards FlexPaxos. We could deviate from our leaderless implementation in v0 and consider leader-based approaches as another knob for us to turn.

The Knob Table: Paxos Variants as Points in a Design-Space #

My framing is that the named algorithms are the same core with different knobs turned. My v0’s Single-decree Paxos is the outcome of setting all the knobs conservatively, to prioritise safety:

  • no leader
  • single decision — single decree
  • it’s 2-phased and both phases run every time
  • always follows majority-quorum rule

Each of the Paxos-variants below relaxes one of those settings and absorbs the cost in some other way. The trade-offs are easier to see if we read the settings as axes within a design space instead of a list. Happily, this also lets us ask the important question: which of these settings does my workload / use-case really need?

Six Knobs #

These are roughly in the order that the series encounters them.

  1. The quorum rule

    Which pairs of sets must overlap, and how large each must be. This is the main point I made in the previous section about quorums. Majority-everywhere is the setting that declines to distinguish the pairs.

  2. Scope: single-decree or log of decisions?

    Is the system deciding one thing (single-decree), or a sequence of things? Paxos decides one value, immutably, forever. Almost every real system wants an ordered log of decisions, which means running multiple instances of the core protocol.

  3. Leadership

    Is any node a distinguished proposer, or may anyone propose? A leader is not required for safety — v0 has none. It exists to improve latency and to reduce contention. It may also simplify implementations.

  4. Phase elision

    Must the first phase run before every decision, or can it run once and amortised across multiple decisions? This knob only becomes available once knobs 2 and 3 are turned.

  5. The message path.

    Does a proposal travel through client \(\Rightarrow\) coordinator \(\Rightarrow\) acceptors, or can the client reach the acceptors directly? Removing the hop removes a message delay and creates the possibility of collisions.

  6. Ordering discipline.

    Must every decision be totally ordered against every other, or only against those that actually conflict?

The Table of Knobs #

Table 3: Paxos variants as knob settings on the single-decree core
VariantKnob(s) turnedBenefitsCosts
Single-decree Paxos2 This is the baselinePrioritises unconditional safety; no special roles; nothing to electtwo phases per decision; duelling proposers can prevent progress indefinitely (livelocking4)
Multi-Paxos4scope \(\Rightarrow\) a sequence; leadership \(\Rightarrow\) one distinguished proposer; phase 1 \(\Rightarrow\) elidedone round trip per decision in the steady stateleader election; on handover the new leader must reconcile slots left half-decided5
Flexible Paxos 6 , 7quorum rule \(\Rightarrow\) only \(Q_{1} \cap Q_{2}\) invariant required, sizes freepractical tuning of systems: small accept quorums; faster and more failure-tolerant steady stateleader election needs a larger quorum, so recovery is less available when it is needed
Fast Paxos8message path \(\Rightarrow\) clients reach acceptors directly, coordinator elided on the fast pathone fewer message delay from client to learnerfast quorums must be larger than a majority; concurrent proposals collide and fall back to a classic round
Raft :— not a paxos variant9 , 10leadership \(\Rightarrow\) restricted; scope \(\Rightarrow\) a single contiguous logone mechanism, understandable end to end; no per-slot reconciliationleadership is available to fewer nodes; the log admits no holes, so one lagging follower delays nothing but one slow leader delays everything
EPaxos (Egalitarian)11ordering discipline \(\Rightarrow\) order only conflicting decisionscommuting operations commit concurrently; no single ordering bottleneckconflict detection and dependency tracking; recovery is substantially more intricate
My Takeaway 2: Paxos’ safety is unconditional but doesn’t have the same guarantee for liveness. It holds safety under any message delay, loss, reordering or duplication. Every knob in the table above is turned in the liveness and latency dimension while safety is held fixed, and non-negotiable.

That’s why I’m framing it as a “design space” rather than a catalogue of algorithms. None of them are without trade-offs / assumptions that may not hold depending on the conditions of where the algorithm is deployed.

Essence of the Algos #

Here are some points that I’ve picked up from implementing / reading on how variants are implemented.

I’ve only implemented the baseline row. For the other variants, I’ve read the papers that elaborate on them. The table of knobs states the claims based on my understanding. The content below describes my understanding. For errata, please reach out to me or open an issue here.

Some correctness pointers to consider based on some initial misconceptions I had:

  1. Multi-Paxos elides Phase 1 (leader election) per leader term across all slots, instead of for every decision.

    I think my misconception stemmed from the fact that leader election is discussed first in the paper, so it’s easy to conflate that it’s per-decision.

  2. Fast Paxos’ fast-quorum is bigger than a majority-rule to make recovery feasible so that progress is ensured. See the 3-way set intersections within the Fast-paxos paperĀ 8

  3. Flex-Paxos’ quorum is asymmetric when comparing phase 1 vs phase 2, not across two of the same phases.

Multi-Paxos: run leader-election once per-term instead of per-decision

So, when running multiple rounds, the elision of the leader-election step is important. A leader runs phase 1 once, with a single proposal number, and that phase 1 covers all future slots rather than the next one.

Each subsequent decision within that term costs a single round-trip: leader sends accept, a quorum replies, the value is chosen.

Leadership transfer is interesting because it has a cost. The moment a leadership transfer happens, all the work that phase 1 was skipping is due at once at that point. This is because when a leader runs its phase 1, the acceptors will report back any values that they’ve already accepted and the leader can’t tell which have been chosen and which haven’t.

The leader therefore chooses to re-propose every value that it hears and if there’s gap, the leader shims it with a noop. Only after that can the new leader start proposing new values.

Fast-Paxos: we bet on low-contention and omit a hop; but we also pay for it

This improves upon Multi-Paxos by shortcutting the path that a message takes.

  • Multi-Paxos: client \(\Rightarrow\) leader, leader \(\Rightarrow\) acceptors, acceptors \(\Rightarrow\) learner (3-hops after client is when the learner receives it)

  • Fast paxos shortcut: client\(\Rightarrow\) acceptors, acceptors \(\Rightarrow\) learner

The price is in the quorum arithmetic. Recovery must be able to determine which value could have been chosen when two clients proposed concurrently into the same round, which requires a classic quorum to intersect two fast quorums at once.

With majority classic quorums this forces fast quorums larger than three quarters of the cluster:

  • 4 of 5, rather than 3 of 5.

In a three-node cluster the fast quorum is all three, so the fast path tolerates no failures at all. This knob wants a larger cluster than the others.

And when two clients do propose at once (competing), acceptors may accept different values in the same round. That is a collision, and it is resolved by falling back to a classic round, which costs more than it saved.

Fast Paxos is a bet on low contention.

Flex-Paxos: need to correctly choose which pairs of quorums to overlap

Given the framing that majority-rule is overly conservative and can be relaxed, that intuition is formalised in Flex Paxos.

Safety guarantee requires that every phase 1 quorum intersect every phase 2 quorum. It does not require two phase 2 quorums to intersect each other, nor two phase 1 quorums.

So, if we had 5 acceptors, accept-quorums of size 2 elect-quorums of size 4 still follow \(4 + 2 > 5\) and guarantee safety.

Leader-failure becomes costlier. To do this, we need to reach a quorum of size 4 / 5.

So the trade is between good steady-state write-latency in exchange for worse availability during recovery (from the asymmetric quorums). Which to choose depends on how often we can expect leadership changes to happen.

Signposts #

Table 4: Meaningful Reads — where to go next
SourceGood for…
“The Part-Time Parliament” (1998, Lamport) 2understanding the beginning — the original paper
“Paxos Made Simple” (2001, Lamport) 4following up from 2, the original algorithm, without the parliament focus; also covers multi-paxos
“Paxos Made Live” (2007, Chandra et al.) 5filling the gap between the paper (academic, theoretical) and a running system — it’s from the perspective of seasoned implementers
“Impossibility of Distributed Consensus with One Faulty Process” — the FLP paper12understanding why liveness cannot be guaranteed and must be engineered around. (It’s because we can’t distinguish a crashed process from a slow one in an async system)
“Viewstamped Replication” (1988, Oki & Liskov)13approaching the same distributed consensus problem solved independently, from the replication side
“Flexible Paxos: Quorum Intersection Revisited”/ (2016, Howard, Malkhi, Spiegelman) 6seeing a formalised approach to turning the quorum knob
“Paxos vs Raft: Have we reached consensus on distributed consensus?” (2020, Howard & Mortier)14comparing and contrasting the two and seeing how close they are
“A Generalised Solution to Distributed Consensus” (2019, Howard, Mortier)15generalising the paxos variants by turning knobs such as the majority rule replaced by an arbitrary intersection rule
“Generalized Consensus” (2025, Sougoumarane)16seeing how the generalisation in 15 and a ground-up framing of rules carries into a system currently being built (Multigres)

Addendum to the addendum: the sections above were feedback-driven, to fill a depth-gap on the fundamentals.

I read the “Generalized Consensus” series recently, and I believe that it’s an important re-frame A buddy of mine needs to add a consensus layer to his product spoon in his road-map (shout-out to paperland) and I’d encourage him to read the generalised framework first before studying the algorithms that are typically implemented as black-boxes (in this case, his need for state-machine replication might make him abandon a log, so a variant like caspaxos may likely fit). of approaching distributed consensus using fundamental, goal-oriented rules. I had to update the “Songs of the OCaml” series to include some ideas from there.

The sections below are my thoughts on reading that series; they remain focused on my goals for this addendum.


Towards Generalised Consensus #

The “Generalized Consensus” series16 builds its framework from the ground up: a small set of hierarchical, goal-oriented rules first, with the familiar named algorithms arriving later as things that happen to satisfy them.

A Trailer to “Generalized Consensus” #

The series16 opens by re-framing distributed consensus as a matter of distributed durability rather than being about agreement between agents in a cluster. It says that agreement is actually the mechanism to solve the problem of distributed durability and that prior art has mainly focused on mechanisms — the way that particular algorithms operate — rather than what the system should deliver (requirements focused on the problems). Through that frame, quorum intersection becomes a property to make a saved decision findable again. It shows Durability and Discoverability as two sides of one coin. A rule that makes data durable without keeping it discoverable can still stall the system — which is just as bad as losing the data because the availability requirement fails either way.

If durability is the requirement, then instead of being a law to follow, durability rules are parameters to inject. Just like the earlier metaphor of knobs in a design-space, we are free to relax conservative rules (e.g. Majority-quorum) and may conjure up durability policies that fit the shape of modern use-cases on modern infrastructure. In a classic Dependency Injection move, the focus then shifts to durability policies that are pluggable… so long as a few custodial restrictions These make the system predictable: a rule may only depend on the current set of participating nodes, node properties (e.g. availability zone) must be static, and no external variables may be depended on. are met. A fundamental observation follows: different leaders may hold different rules at the same time. This heterogeneity is what turns the job from a configuration option into a systems problem — a ruleset is now a decision in its own right and it’s replicated state that whoever takes over next has to discover and reconcile before it can act.

We learn that there’s a paper (“A Generalised Solution to Distributed Consensusā€15) that is similarly-named but the two actually aim to do different things The two works do overlap when discussing the concepts of revocation and flexible durability rules. . The paper works on demonstrating a single algorithm that is general enough for the named protocols to show themselves as its instances while the blog-series establishes a general framework for adapting a consensus system to the environment that it has to run in.

Spoilers: The framework’s governing rules that make this treatise tractable

The series makes it clear that it’s providing a framework for a generalised approach and not dictating an implementation approach.

It defines 2 rules17 that govern the correctness of the framework to maintain its safety guarantees. I’ve transcribed I’ve taken minor liberties to editorialise this, the original phrasing is here them here.

These numbered rules are hierarchical: satisfy a parent rule and you needn’t follow its sub-parts:

  1. Durability Rule

    1. A distributed decision must be made durable

    2. A decision that is durable can be applied

  2. Consistency Rule

    1. Revocation: every agent must revoke all previous agents’ ability to make further progress before taking any action.

      So, every agent must also give a way for future agents to revoke its ability to make progress

    2. Rediscovery and Repeating: every agent must be able to discover decisions that have been made durable but haven’t been applied yet. Upon discovering:

      1. Honouring: If it’s not possible to know if a decision has met the durability criteria, the agent must honour it because it may have been applied

        • honoured decisions must be made durable by the current agent
      2. Inference: if there’s conflicting timelines , the newest one must be chosen

The magic of this series is in how it layers fresh constraints/concepts in a way that they naturally reduce to an earlier point that it would have established. The rules in the early parts are what the later ones obey — the 11-parts should be read in order for them to have a satisfactory, snap-together feel.

Figure 3: šŸ™™ A satisfactory snap-together feel (retrieved) šŸ™›

A Conceptual Keystone: Why Revocation Is a Primitive #

Reading “Generalized Consensus”Ā 16 with an implementation already written is a different experience from reading it cold. v0 is a deterministic, single-decree Paxos simulator. It’s small enough that the OCaml type system is the primary subject and Paxos the learning substrate — and small enough that revocation never came up. “Generalized Consensus” makes revocation a rule and shows how other concepts reduce to it. The implementation it suggests fuses revocation back into the steps around it, and that fusion of mechanisms is where I would have gotten it wrong.

Revocation Is Not Only a Lock-Out #

Rule 2a in “Generalized Consensus”16 opens by asking one thing of an agent The series’ generic term for whoever is currently entitled to make a decision on the cluster’s behalf. In a leader-based system there are at least two kinds: the leader, which fulfils requests, and the coordinator, which changes leadership. before it may take any action: revoke every previous agent’s ability to make further progress. Read quickly, this revocation rule sounds like clearing the desk before starting work — housekeeping.

Read past the prohibition and the same rule is an act of discovery: stated as what an agent must stop, it also fixes what the agent finds. This second reading is the one I arrived at late.

The foundations above and “Generalized Consensus” start from the same premise: a quorum is a set of nodes, and majority is convenient rather than necessary. That’s Takeaway 1 and their shared upstream is FlexPaxos The writer of the ā€œGeneralized Consensusā€ series16, Sugu Sougoumarane, published his own account of the same relaxation in 20167, cited in the knob-table. Ā 6, cited in both. Mine stops there. I treated intersection as a safety property: something that stops the asker It’s a term I used for an example above about quorums being set intersections. from contradicting a decision that already happened (Case A is the counter-example). That reading turned Takeaway 1 into a question about which design-knob yields which protocol-variant: a question about algorithms, asked from inside them. The series declines that reading rather than reinterpreting it — ‘intersecting quorums’ appears in its list of terms it will not use, replaced by discovery, revocation and candidacy.

Three observations on the framework’s rules:

  1. The sweep that stops the incumbent is what produces the discovery of state, and what it finds determines which requests get honoured after a failure. To stop the incumbent, the revoking set must contain a node from every combination the incumbent could have made a request durable with. A set that hits every such combination has also seen every request that reached one — and some of the merely-attempted ones.

  2. Which nodes belong in the revoking set is a separate question from who is taking over (i.e. the candidate). Paxos and Raft ask for a majority, and a majority Specifically, prepare message for Paxos, RequestForVote for Raft. satisfies revocation and candidacy at once, so the two never appear as separate requirements. Relax the quorum rule and they need not be the same nodes.

  3. How far the revoking set has to reach isn’t set by the incumbent either. A coordinator An agent that sits outside the cohort. It health-checks the nodes and, when it concludes there’s a failure, appoints a new leader. Several coordinators can be deployed — placed across availability zones — and they aren’t aware of each other. They may overlap in their purview too. must revoke every leadership the ruleset The durability policy made concrete: the list of cohort nodes, which of them are eligible to lead, and for each of those, the node combinations that count as durable. Every cohort node stores it. permits — not just the one it thinks is currently leading. Each of those primaries has to be left unable to complete a request, either by recruit-ing Asking a node to move up to your term number. It accepts only if yours is higher. You don’t have to say why — what the nodes get used for is decided afterwards. it directly or by denying it every combination of nodes it could complete with. Under majority-everywhere a single majority discharges that for all of them at once; once leaders A leader is a node in the cohort currently empowered to accept requests and make them durable. It serves until its leadership is revoked; there’s no expiry. The series also calls these primaries when listing which nodes are eligible. hold different rules, each has to be accounted for separately. That is what makes a heterogeneous ruleset safe: a write need only reach any leader’s quorum, and recovery finds the alternates.

None of the three is dimensioned by what the new agent intends to do. Something that self-contained looks like it should be folded into the mechanisms it serves — into discovery, into candidacy, into the ruleset change itself.

In this framework, it nearly is. A coordinator achieves all four Part 11 verbatim: ā€œA single step achieves the above four goals: The coordinator increments its current term number and sends a message to recruit all the nodes in the cohort.ā€ in one step: it increments its term and sends a single recruitment message to the cohort The full set of nodes responsible for meeting the system’s durability requirements — the ones that persist logs. Coordinators are not part of it. , and revocation, candidacy and discovery arrive as goals of that one step rather than three steps of their own. Recruitment doesn’t even distinguish revocation from candidacy — the same message that revokes is the message that recruits a candidate. The node a coordinator intends to install as the next leader. It becomes the leader when the coordinator delegates its term to it.

And yet the three sit differently in the rules. Candidacy never appears as a rule at all. Revocation of candidacy and revocation of leadership are the same act, and that is not a coincidence: revocation works by disrupting durability, and the only durability rules in the system apply to leaderships. Discovery has a rule of its own, but the mechanism that satisfies it is what the series calls a 'serendipitous side effect' The writer’s words, not mine. of revocation. Revocation alone is a rule with nothing that it can further reduce to.

One message fuses all three. What breaks if the concepts fuse too?

The Entry Price for Manufactured Authority #

What breaks is our intuition on the costs of revocation.

Suppose we fuse the concepts: revocation becomes a step inside a procedure — e.g. something a leadership change does — so its cost must belong to that operation.

It doesn’t, though. Authority is a quantity distributed across the cohort’s persisted term ā€œGeneralized Consensusā€ adopts Raft’s terminology. term is Raft’s name for the number that orders decisions; Paxos calls it a proposal number. Every node persists the term it last agreed to, rejects requests from any lower term, and can be recruited into a higher one. numbers, not a property that an agent holds. A term number means nothing until nodes have been recruited into it. Acquiring authority and draining it from the incumbent are one act seen from two ends Authority accumulating on the coordinator’s side, the ability to reach a quorum draining on the incumbent’s side , rather than being two steps in sequence. Revocation can’t be folded into discovery or candidacy because it’s not a precondition of those steps; they are things that revocation does.

Revocation is achieved by recruiting nodes into a higher term, and there are two routes:

  1. recruit the incumbent directly, so that it relinquishes leadership and it waits for further requests

  2. recruit the nodes that the incumbent relies on for durability, so that those nodes stop accepting its requests — like a mutiny

Both routes are recruitment; neither is a separate revoking instruction.

If revocation is part of what a leadership change is, then a leadership change must be disruptive — the incumbent stops being able to complete requests, and writes stall until a successor is established. There’s no version of it that skips the revoking.

The framework shows otherwise. A planned leadership change is handed to the current leader as a request it fulfils like any other, with the quorum for that sole request widened to include the intended leader’s rules. Once applied Irreversible commitment of a decision — e.g. a commit for a database, an fsync for a filesystem. Only safe once the decision can no longer be abandoned. , the leader steps down and the successor observes the event and promotes itself, and no new term is started Part 8 verbatim on planned leadership change: ā€œAgain, there is no need to start a new term number for this method.ā€ . This leader-method is possible because the leader already holds what a coordinator would have had to manufacture, so there’s no second writer to lock-out. This is not some special case of cleverness. There’s no need for a new term, so there’s nothing to recruit which means nothing to revoke. It’s the same operation, just that the router varies The agent that actually brings in the change. Here, instead of being the coordinator, it’s the leader itself. .

My Takeaway 3: Revocation is not the price of changing the rules, nor even of changing the leader — both can be issued to the leader as ordinary requests, with no new term and no disruption. It is the “entry price” of arriving from outside: of an agent that has to manufacture the authority a leader already holds. The coordinator method pays it because it is built on the leadership-change protocol and inherits its revoke-then-recruit shape — so the traffic disruption is the cost of the inheritance, not of the change being made.
All of this rests on the coordinator having no authority of its own. Why can’t it have some?

A Coordinator Is Not a Supervisor #

A process that watches a set of nodes, health-checks them, decides if one of them has failed, and installs a replacement is a strikingly familiar shape. In some systems, such an entity does hold authority of its own as a supervisor. That’s the mental model that I initially had for the coordinator, carried over from OTP18 supervision trees. A coordinator connects to every node in the cohort, keeps its picture of the current leader, term and ruleset up to date, and walks a decision-tree that ends with one of two actions: change the leader, or do nothing.

A supervisor’s authority is structural — it never acquires it at the moment it acts; it already has it because of how the system was built. It spawns its children, holds links to them, and the parent-child relationships exist before any failure does. A supervision tree makes parenthood exclusive by construction, so a supervisor never has to consider whether some second supervisor is restarting the same child at the same moment.

A coordinator, as described in the framework, has none of that. It doesn’t create the leader, it doesn’t own the log. Any authority it has, it has to go and acquire — and the only instrument for that is a term number.

A supervisor is a lock with a process-tree around it. The series considers such a lock and sets it aside because a lock can’t carry a proof. We can’t bound how long a process takes, so a timeout can elapse mid-action; and clocks drift, so an agent can believe it still holds time everyone else considers expired. Either way, a second agent starts acting, and sequentiality is violated. Part 5 gives both reasons in its detour on distributed locks.

So, even though exclusivity is available, it’s not provable, and the term number machinery is what gets built instead. The “Generalized Consensus” series is careful, rather than dismissive, about this distinction. It keeps locks and timeouts viable as long as the trade-offs are understood, and notes that Vitess runs this way Part 5: ā€œWe shouldn’t dismiss this approach… In fact, Vitess employs this approach.ā€ .

An agent that cannot prove it is alone has to assume that it is being raced. And because a crashed coordinator is indistinguishable Per the FLP resultĀ 12, which the series cites for exactly this. from a slow one, it has to assume it will never find out. That is why the scope for revocation is every leadership the ruleset permits, not just the incumbent’s.

An arch is the picture I keep coming back to. Its keystone is not a separate kind of stone — it’s cut and set in the same course as the stones beside it, doing the same job they do.

Take out the keystone and none of them hold.
Figure 4: People standing on the keystone of the Arch of Ctesiphon — at the remains of the palace at Ctesiphon, Iraq. (retrieved, photo taken 1864 CE)

Looking Forward #

Earlier, I said that the fusion is where I would have gotten it wrong. v0’s scope also let the quorum-checks use the convenient, number-based approach — majority-everywhere makes a count sufficient — even though Takeaway 1 had just argued that a quorum is a set and size is merely a property of it.

271
272
273
274
275
276
277
278
279
280
281
  (** Quorum predicate for both phase 1 and phase 2 of paxos.*)
  let is_quorum_reached cluster_size rs =
    match Proposer |> get_role rs with
    | WaitingForPromises wfp ->
        wfp |> is_quorum_reached_on_promise_wait cluster_size
    | ProposerAccepting pa ->
        pa |> is_quorum_reached_on_proposer_accepting_wait cluster_size
    | _ ->
        failwith
          "is_quorum_reached called on non-proposer state (must be \
           WaitingForPromises or ProposerAccepting)"
Code Snippet 1: quorum predicate function, convenient implementation for v0

A quorum typed as a count can’t express node-identity rules — which combinations of nodes qualify — and combinations are exactly what a revoking set has to hit. The count isn’t confined to one signature either; it’s threaded through the helpers beneath it. Changing that will be v1’s problem. Knowing that now, before v1 exists, is most of what reading the series bought me.

There’s still something that I can’t yet judge:

Relax the quorum rule and revocation and candidacy need not be satisfied by the same nodes — that’s observation 2. What does this separation cost when two coordinators race for the same term? A majority rule guarantees one of them fails and Part 10 says the recruitment options always overlap. I can’t yet see what makes a heterogeneous ruleset owe me that.

I expect to find out when I write v1. Preferably not as a hobby.


  1. The book, “Designing Data-Intensive Applications” is a classic read that goes through the basics. I have some rough notes on the 1st edition’s Chapter 9 (Consistency and Consensus) here. The latest (2nd) edition released in February 2026, I’ve skimmed through it but notes aren’t updated yet. ↩︎

  2. The legendary Leslie Lamport laid the foundations for managing chaos in distributed systems. The Paxos algorithm was published in the 90’s as “The Part-Time Parliament”, which built on his earlier work around the space. ↩︎ ↩︎ ↩︎ ↩︎ ↩︎

  3. “Robert’s Rules of Order”, a manual of parliamentary procedure – the Wikipage for “Quorum” relies on this too. ↩︎

  4. Leslie Lamport, “Paxos Made Simple” (2001), introduces the multi-decree extension and also walks through how two duelling proposers may livelock the system. It’s funny because in his writings on his blog he mentions that he had to write this paper because the original one2 was too difficult for students to understand. ↩︎ ↩︎ ↩︎

  5. “Paxos Made Live: An Engineering Perspective” (2007): This is a Google-paper on the real-world experience implementing Multi-Paxos in databases. I’ve done a shallow-read of this implementation-focused paper, so there’s much more to internalise from it. ↩︎ ↩︎

  6. “Flexible Paxos: Quorum Intersection Revisited” (2016, Heidi Howard, Dahlia Malkhi, and Alexander Spiegelman): This paper demonstrates that intersection is only required across two phases of Paxos; majority quorums are therefore sufficient but not necessary. ↩︎ ↩︎ ↩︎

  7. “A More Flexible Paxos” (2016, – Sugu Sougoumarane): This post was written to explain a similar re-framing of intersecting quorums in the words of the co-creator of Vitess. ↩︎ ↩︎

  8. “Fast Paxos” (2006): Leslie Lamport — a faster paxos by noticing that when there’s no contention, we can just let learning occur in 2-message delays ↩︎ ↩︎

  9. Raft is lucky to have its own dedicated landing page, with compilation of user-generated material, papers and so on. The landing page has a nice animation to play with and understand the algorithm. ↩︎

  10. The Raft Paper: “In Search of an Understandable Consensus Algorithm” (2014) ↩︎

  11. Egalitarian Paxos, EPaxos, is the most fascinating to me because it’s most analogous to a democratic system. There are numerous papers on this:

    1. “There Is More Consensus in Egalitarian Parliaments” (2013) is the original paper
    2. There’s a follow-up proof-of-correctness via the paper “A Proof of Correctness for Egalitarian Paxos” (2013).
    3. I’ve not read the following paper as deeply as the rest (especially because it’s the freshest) — “Making Democracy Work: Fixing and Simplifying Egalitarian Paxos (Extended Version)” (2025)
     ↩︎
  12. In 1985, Fischer, Lynch and Paterson showed that no deterministic protocol can guarantee both safety and termination in an asynchronous system where even one process may fail. Paxos resolves this by never sacrificing safety and allowing progress to stall. ↩︎ ↩︎

  13. “Viewstamped Replication: A New Primary Copy Method to Support Highly-Available Distributed Systems” is a paper that explores how HA may be achieved by using a copying technique from the replication-side. ↩︎

  14. The paper, “Paxos vs Raft: Have we reached consensus on distributed consensus?” (2020, Howard & Mortier) is a useful compare and contrast exercise and concludes that these are more alike than their reputation suggests. ↩︎

  15. “A Generalised Solution to Distributed Consensus” (2019, Howard, Mortier) — a paper that generalises how the paxos variants may be implemented. ↩︎ ↩︎ ↩︎

  16. “Generalized Consensus” is a blog series by Sugu Sougoumarane, of Vitess fame, whose team is currently building a Postgres version of Vitess, Multigres ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎

  17. The actual phrasing for the rules without my editorialising is from part 3 of the series. These rules govern how distributed systems may meet their safety guarantees. ↩︎

  18. OTP is Erlang’s standard library and design principles, inherited by Elixir. A supervisor starts child processes, monitors them, and restarts them on a declared strategy. Supervisors supervise supervisors, so an application is a tree, declared up front. ↩︎