← The Books

The Part-Time Parliament

How can a group of machines agree on a single sequence of commands when any of them may crash and recover at any moment, messages can be delayed or lost, and no one stays in charge for long?

Leslie Lamport answered this question himself by inventing the part-time legislators of the ancient Greek island of Paxos, the allegory that inspired this entire series. Here his story is carried over with interactive figures. (While Lamport ends his paper with a scribe's blunder that topples the parliament, this telling sets that catastrophe aside: on our island, the parliament is still sitting.)

We find out by following the protocol itself: a group of processes that must agree on a sequence of values while any of them may stop or return at any moment, and messages can be delayed, duplicated or lost.

After Leslie Lamport, The Part-Time Parliament, 1998 · Leslie Lamport, Paxos Made Simple, 2001

Before the round Chamber of Paxos in the morning, two messengers in blue run across the terrace while five legislators walk behind them with scrolls in their hands
Where this book sits
Draws on
This book retells
Leads to
  • How to Build a Highly Available System Using ConsensusLampson 1996
  • Revisiting the Paxos AlgorithmDe Prisco, Lampson & Lynch 1997
  • Practical Byzantine Fault ToleranceCastro & Liskov 1999 · Keeping Order Among Liars
  • Flexible Paxos: Quorum Intersection RevisitedHoward, Malkhi & Spiegelman 2016

Each link traces an idea that one paper borrowed from another. Point at a link, or tap it, to see how.

a paper this book retells a paper retold in another book a paper outside the series

Inside the Chamber, legislators in white sit well apart on the benches round the wall, each writing on a scroll; a messenger in blue crosses the floor and a scholar walks out by the open door
The Chamber of the Paxon ParliamentThe model

A parliament whose members come and goProcesses that come and go

Paxos is an island of busy merchants where trade comes before civic duty. Because no citizen is willing to devote their entire life to politics, the island's legislators serve part-time, wandering in and out of the round parliamentary Chamber whenever their business allows.A group of processes each keep a log of the decisions the group has made. No process is willing to stay up forever, so each may stop or restart at any time, and processes communicate only by messages.

One doorAny legislator may walk out through the door at any moment, even in the middle of a vote, and stay away for as long as they please.Crashes at any timeAny process may stop at any moment, even in the middle of a vote, and stay down for as long as it pleases.
A scroll eachBecause no clerk is willing to sit permanently in the Chamber to keep an official ledger, every legislator carries their own parchment scroll (stable storage).Stable storageEvery process has its own durable storage (stable storage) that survives a crash; nothing else does.
No podiumThe acoustics of the round stone hall are so poor that speeches cannot be heard across the floor; legislators communicate only by sending messengers with written notes.Only messagesProcesses communicate only by sending messages; there is no shared memory.
What the Parliament must doWhat the protocol must do

Settle the law, one numbered decree at a timeSettle a log, one numbered value at a time

The law of Paxos is the numbered sequence of decrees passed by its Parliament. Each legislator writes passed decrees into their personal scroll by number, using indelible ink that can never be erased or altered. Parliamentary procedure must guarantee two properties for those scrolls:The log is the numbered sequence of values that the group has decided. Each process writes decided values into its own log by slot number, durably, so they can never be erased or altered. The protocol must guarantee two properties for those logs:

Requirement one: consistency (safety)

No two scrolls may ever contradict each other. If one legislator's scroll says that Decree 132 orders all lamps to burn pure olive oil, no other legislator's scroll may record a different Decree 132. (A scroll may, of course, still have a blank space at slot 132 if its owner has been away and has not yet heard that Decree 132 was passed.)No two logs may ever contradict each other. If one process's log says that slot 132 holds the value “set the lease timeout to 30 s”, no other process's log may record a different value for slot 132. (A log may, of course, still have a blank at slot 132 if its process has been down and has not yet learned what was decided.)

Part-time legislators immediately put this consistency in danger. Step through the panel below to see what goes wrong when one group of legislators passes a decree and leaves for a banquet, and a second group walks in knowing nothing about it.Processes that come and go immediately put this consistency in danger. Step through the panel below to see what goes wrong when one group of processes decides a value and stops, and a second group starts up knowing nothing about it.

Two groups, one number press the buttons in orderTwo groups, one slot press the buttons in order

Three legislators are in the Chamber, with decree 37 before them. The other three are away.Three processes are running, with slot 37 before them. The other three are down.

Requirement two: progress (liveness)

Consistency by itself would be trivial to preserve if nobody ever wrote anything down, blank scrolls never disagree! So Parliament also requires progress: whenever a majority of the legislators remain inside the Chamber for long enough without anyone entering or leaving, any decree proposed there must eventually pass and be written into the scroll of every legislator present.Consistency by itself would be trivial to preserve if nobody ever wrote anything down, blank logs never disagree! So the protocol also requires progress: whenever a majority of the processes stay up and connected for long enough without anyone stopping or starting, any value proposed must eventually be decided and written into the log of every process running.

No protocol can promise more than that when legislators are free to walk out whenever they wish.* The entire challenge is to guarantee both consistency and progress among people who may vanish halfway through a vote. First, let us see the exact rules of the island they had to work under.No protocol can promise more than that when processes are free to stop whenever they wish.* The entire challenge is to guarantee both consistency and progress among processes that may vanish halfway through a vote. First, let us see the exact rules of the system they had to work under.

The round Chamber of Paxos in golden evening light: priests in white wander round the colonnade at their own pace, one shading his eyes, a marble bust on its pillar in the foreground
What can go wrong

Everyone is honest, and anyone may be absentAll processes are honest, and any may stop

On Paxos, legislators and messengers are scrupulously honest: nobody ever lies, forges a note, or breaks the rules of parliamentary procedure (non-Byzantine faults). What no one can be counted on to do is stay in the room.Processes and messages are scrupulously honest: nobody ever lies, forges a message, or breaks the protocol (non-Byzantine faults). What no one can be counted on to do is stay up.

Every rule of Parliament must work under three practical realities:Every rule of the protocol must work under three practical realities:

A marble bench against the Chamber's stone wall: a woman sits with an open scroll across her knees while a bearded man in a white tunic leans over, watching the sand run in a small sandglass on the bench

Memory walks out the doorMemory is lost in a crash

A legislator who leaves the Chamber forgets what they were in the middle of doing. Anything that must survive an absence has to be written in the back of their scroll in indelible ink (stable storage). Temporary scratch notes go on a loose slip of papyrus (volatile memory), which may be lost whenever the legislator steps out.A process that crashes forgets what it was in the middle of doing. Anything that must survive a crash has to be written to stable storage. Temporary working state lives in volatile memory, which may be lost whenever the process stops.

Inside the Chamber, a messenger in blue hands a folded slip to a legislator seated on a bench; further along the wall another legislator writes, and two more messengers cross the sunburst floor

Absent-minded messengersUnreliable messages

Legislators communicate only through messengers. A messenger never alters the text of a note, but may take arbitrarily long to cross the hall, may forget they already delivered a note and deliver it a second time, or may wander off on a sea voyage and never deliver it at all.Processes communicate only through messages. A message is never altered, but may take arbitrarily long to arrive, may be delivered a second time, or may never arrive at all.

Inside the Chamber, legislators in white sit well apart on the benches round the wall, each writing on a scroll; a messenger in blue crosses the floor and a scholar walks out by the open door

Prompt when present, unbounded when awayPrompt when up, unbounded when down

While two legislators remain inside the Chamber, a messenger can carry a note between them and return with an answer within the turn of a sandglass. Once someone steps out the door, however, any delay is possible.While two processes stay up and connected, a message can be delivered and answered within a known time. Once either stops, however, any delay is possible.

Those unreliable messengers are what make coordination tricky. Dispatch a few messengers across the floor below to see what can happen to any note.Unreliable messages are what make coordination tricky. Send a few messages below to see what can happen to any one of them.

Send a message try your luck

0delivered0delivered twice0never arrived

A message may arrive once, arrive twice, or never arrive.

When a legislator receives no reply, they cannot tell whether the messenger is still crossing the hall, lost at sea, or waiting on a colleague who walked out the door. Yet the scrolls must never disagree! The Paxons solved this by relying on a single arithmetic fact that no amount of wandering can ever undo.When a process receives no reply, it cannot tell whether the message is still in transit, lost, or waiting on a process that has stopped. Yet the logs must never disagree! The protocol solves this by relying on a single arithmetic fact that no amount of stopping and starting can ever undo.

The one fact everything rests on

Any two majorities share a member

No matter how legislators wander in and out of the Chamber, two majorities of the same Parliament can never consist of completely disjoint sets of people. At least one legislator is guaranteed to belong to both (quorum intersection).No matter how processes stop and start, two majorities of the same group can never consist of completely disjoint sets of processes. At least one process is guaranteed to belong to both (quorum intersection).

That shared member acts as a bridge across time: as long as they record their votes in indelible ink in the back of their scroll, they carry the memory of what the first majority did into the second majority, even if everyone else from the first group has left the building. On the right are seven legislators seen from above the Chamber. Click any legislator to send them out through the door or call them back in; then let one majority pass a decree and watch who is still present when a second majority gathers.That shared member acts as a bridge across time: as long as it records its votes in stable storage, it carries the memory of what the first majority did into the second majority, even if every other member of the first has stopped. On the right are seven processes. Click any process to stop it or start it again; then let one majority decide a value and watch who is still up when a second majority gathers.

Send some legislators out through the door first, if you like.Stop some processes first, if you like.
the one door

A smaller puzzle first

One decree, once every nineteen yearsAgreeing on a single value

Before we see how Parliament agrees on a whole sequence of decrees, let us solve the simpler puzzle from which Parliament's rules grew (Single-Decree Paxos, or the Synod protocol). Long before Parliament existed, a Synod of Paxon temple priests met once every nineteen years to choose a single symbolic decree. When the priests, too, began wandering in and out during the proceedings, one Synod ended in chaos without choosing anything.Before we see how the group agrees on a whole sequence of values, let us solve the simpler puzzle from which the protocol grew (single-decree Paxos): getting a group of processes to choose a single value, even though processes may stop and restart during the proceedings.

To make sure that never happened again, Paxon mathematicians designed a voting procedure based on numbered ballots. Any priest may initiate a ballot: each ballot has a unique ballot number, proposes a single decree, and is addressed to a chosen majority of priests called its quorum. Each priest in the quorum may either vote for the ballot's decree or not vote at all, and a ballot succeeds if and only if every member of its quorum votes for it. Any number of ballots can be held over time, and whenever any ballot succeeds, its decree becomes the Synod's official choice.The solution is a voting procedure based on numbered ballots. Any process may initiate a ballot: each ballot has a unique ballot number, proposes a single value, and is addressed to a chosen majority of processes called its quorum. Each process in the quorum may either vote for the ballot's value or not vote at all, and a ballot succeeds if and only if every member of its quorum votes for it. Any number of ballots can be held over time, and whenever any ballot succeeds, its value becomes the chosen value.

To guarantee that two different ballots never succeed with two different decrees, the mathematicians laid down three fundamental rules (conditions B1, B2, and B3):Two different ballots can never succeed with two different values, and three fundamental rules (conditions B1, B2, and B3) guarantee it:

RULE ONE · B1

Every ballot has a unique number

No two ballots ever share the same ballot number, so between any two ballots there is always a well-defined earlier one and later one.

RULE TWO · B2

Any two quorums share a priestAny two quorums share a process

Every ballot's quorum is a majority of the priests, so any two quorums are guaranteed to have at least one priest in common.Every ballot's quorum is a majority of the processes, so any two quorums are guaranteed to have at least one process in common.

RULE THREE · B3

A ballot carries the latest vote forward

If any priest in a new ballot's quorum has ever voted in an earlier ballot, the new ballot must propose the exact same decree as the highest-numbered earlier ballot in which any member of its quorum voted.If any process in a new ballot's quorum has ever voted in an earlier ballot, the new ballot must propose the exact same value as the highest-numbered earlier ballot in which any member of its quorum voted.

Rule Three is the heart of the algorithm. An ancient Paxon manuscript illustrates how it works across five ballots held among five priests (Α, Β, Γ, Δ, and Ε). Click any ballot in the table below to see why its decree was chosen:Rule Three is the heart of the algorithm. The table below shows five ballots held among five processes (P1, P2, P3, P4, and P5). Click any ballot to see why its value was chosen:

The manuscript click a ballotThe ballots click a ballot

Each row is one ballot, with its number, its decree and its quorum. A boxed priest is one who voted. Click a ballot to see whether it was free to choose its decree or had to copy an earlier one, and from whom.Each row is one ballot, with its number, its value and its quorum. A boxed process is one that voted. Click a ballot to see whether it was free to choose its value or had to copy an earlier one, and from whom.

BallotDecreeValueQuorum
Try ballot 27.

See how the three rules lock in a decision once a ballot succeeds (say, Ballot 14 in the table above, where every member of the quorum {Β, Δ, Ε} voted for decree α): any later ballot's quorum is a majority, so by Rule Two it must include at least one priest from {Β, Δ, Ε}. That priest cast a vote in Ballot 14, so the highest-numbered vote prior to the new ballot among its quorum is at least 14, and by induction, Rule Three forces the very next ballot after 14, and every ballot after that, to propose α! Therefore, no two successful ballots can ever choose different decrees.See how the three rules lock in a decision once a ballot succeeds (say, ballot 14 in the table above, where every member of the quorum {P2, P4, P5} voted for value α): any later ballot's quorum is a majority, so by Rule Two it must include at least one process from {P2, P4, P5}. That process cast a vote in ballot 14, so the highest-numbered vote prior to the new ballot among its quorum is at least 14, and by induction, Rule Three forces the very next ballot after 14, and every ballot after that, to propose α! Therefore, no two successful ballots can ever choose different values.

Now let us see how the priests turn these three abstract rules into a concrete two-phase message protocol.Now let us see how the processes turn these three abstract rules into a concrete two-phase message protocol.

The three rules, formally · and the proofs that they give consistency

Each ballot B has a number Bbal, a decree Bdec, a quorum Bqrm and a set of voters Bvot, and ℬ is a set of ballots. The three rules are the conditions B1(ℬ), B2(ℬ) and B3(ℬ). A ballot is successful when Bqrm ⊆ Bvot.

To state B1(ℬ)–B3(ℬ) formally requires some more notation. A vote v was defined to be a quantity consisting of three components: a priest vpst, a ballot number vbal, and a decree vdec. It represents a vote cast by priest vpst for decree vdec in ballot number vbal. The Paxons also defined null votes to be votes v with vbal = −∞ and vdec = blank, where −∞ < b < ∞ for any ballot number b, and blank is not a decree. For any priest p, they defined nullp to be the unique null vote v with vpst = p.

Paxon mathematicians defined a total ordering on the set of all votes, but part of the manuscript containing the definition has been lost. The remaining fragment indicates that, for any votes v and v′, if vbal < v′bal then v < v′. It is not known how the relative order of v and v′ was defined if vbal = v′bal.

For any set ℬ of ballots, the set Votes(ℬ) of votes in ℬ was defined to consist of all votes v such that vpst ∈ Bvot, vbal = Bbal, and vdec = Bdec for some B ∈ ℬ. If p is a priest and b is either a ballot number or ±∞, then MaxVote(b, p, ℬ) was defined to be the largest vote v in Votes(ℬ) cast by p with vbal < b, or to be nullp if there was no such vote. Since nullp is smaller than any real vote cast by p, this means that MaxVote(b, p, ℬ) is the largest vote in the set

{v ∈ Votes(ℬ) : (vpst = p) ∧ (vbal < b)} ∪ {nullp}

For any nonempty set Q of priests, MaxVote(b, Q, ℬ) was defined to equal the maximum of all votes MaxVote(b, p, ℬ) with p in Q.
Conditions B1(ℬ)–B3(ℬ) are stated formally as follows.8

B1(ℬ) ≜ ∀B, B′ ∈ ℬ : (B ≠ B′) ⇒ (Bbal ≠ B′bal)
B2(ℬ) ≜ ∀B, B′ ∈ ℬ : Bqrm ∩ B′qrm ≠ ∅
B3(ℬ) ≜ ∀B ∈ ℬ : (MaxVote(Bbal, Bqrm, ℬ)bal ≠ −∞) ⇒ (Bdec = MaxVote(Bbal, Bqrm, ℬ)dec)

Although the definition of MaxVote depends upon the ordering of votes, B1(ℬ) implies that MaxVote(b, Q, ℬ)dec is independent of how votes with equal ballot numbers were ordered.

8. I use the Paxon mathematical symbol ≜, which meant equals by definition.

To show that these conditions imply consistency, the Paxons first showed that B1(ℬ)–B3(ℬ) imply that, if a ballot B in ℬ is successful, then any later ballot in ℬ is for the same decree as B.

Lemma

If B1(ℬ), B2(ℬ), and B3(ℬ) hold, then

((Bqrm ⊆ Bvot) ∧ (B′bal > Bbal)) ⇒ (B′dec = Bdec)

for any B, B′ in ℬ.

Proof of Lemma

For any ballot B in ℬ, let Ψ(B, ℬ) be the set of ballots in ℬ later than B for a decree different from B’s:

Ψ(B, ℬ) ≜ {B′ ∈ ℬ : (B′bal > Bbal) ∧ (B′dec ≠ Bdec)}

To prove the lemma, it suffices to show that if Bqrm ⊆ Bvot then Ψ(B, ℬ) is empty. The Paxons gave a proof by contradiction. They assumed the existence of a B with Bqrm ⊆ Bvot and Ψ(B, ℬ) ≠ ∅, and obtained a contradiction as follows.9

  1. Choose C ∈ Ψ(B, ℬ) such that Cbal = min{B′bal : B′ ∈ Ψ(B, ℬ)}.
    Proof: C exists because Ψ(B, ℬ) is nonempty and finite.
  2. Cbal > Bbal
    Proof: By 1 and the definition of Ψ(B, ℬ).
  3. Bvot ∩ Cqrm ≠ ∅
    Proof: By B2(ℬ) and the hypothesis that Bqrm ⊆ Bvot.
  4. MaxVote(Cbal, Cqrm, ℬ)bal ≥ Bbal
    Proof: By 2, 3 and the definition of MaxVote(Cbal, Cqrm, ℬ).
  5. MaxVote(Cbal, Cqrm, ℬ) ∈ Votes(ℬ)
    Proof: By 4 (which implies that MaxVote(Cbal, Cqrm, ℬ) is not a null vote) and the definition of MaxVote(Cbal, Cqrm, ℬ).
  6. MaxVote(Cbal, Cqrm, ℬ)dec = Cdec.
    Proof: By 5 and B3(ℬ).
  7. MaxVote(Cbal, Cqrm, ℬ)dec ≠ Bdec
    Proof: By 6, 1, and the definition of Ψ(B, ℬ).
  8. MaxVote(Cbal, Cqrm, ℬ)bal > Bbal
    Proof: By 4, since 7 and B1(ℬ) imply that MaxVote(Cbal, Cqrm, ℬ)bal ≠ Bbal.
  9. MaxVote(Cbal, Cqrm, ℬ) ∈ Votes(Ψ(B, ℬ))
    Proof: By 7, 8, and the definition of Ψ(B, ℬ).
  10. MaxVote(Cbal, Cqrm, ℬ)bal < Cbal
    Proof: By definition of MaxVote(Cbal, Cqrm, ℬ).
  11. Contradiction
    Proof: By 9, 10, and 1.

End Proof of Lemma

9. Paxon mathematicians always provided careful, structured proofs of important theorems. They were not as sophisticated as modern mathematicians, who can omit many details and write paragraph-style proofs without ever making a mistake.

With this lemma, it was easy to show that, if B1–B3 hold, then any two successful ballots are for the same decree.

Theorem 1

If B1(ℬ), B2(ℬ), and B3(ℬ) hold, then

((Bqrm ⊆ Bvot) ∧ (B′qrm ⊆ B′vot)) ⇒ (B′dec = Bdec)

for any B, B′ in ℬ.

Proof of Theorem

If B′bal = Bbal, then B1(ℬ) implies B′ = B. If B′bal ≠ Bbal, then the theorem follows immediately from the lemma. End Proof of Theorem

The Paxons then proved a theorem asserting that if there are enough priests in the Chamber, then it is possible to conduct a successful ballot while preserving B1–B3. Although this does not guarantee progress, it at least shows that a balloting protocol based on B1–B3 will not deadlock.

Theorem 2

Let b be a ballot number and Q a set of priests such that b > Bbal and Q ∩ Bqrm ≠ ∅ for all B ∈ ℬ. If B1(ℬ), B2(ℬ), and B3(ℬ) hold, then there is a ballot B′ with B′bal = b and B′qrm = B′vot = Q such that B1(ℬ ∪ {B′}), B2(ℬ ∪ {B′}), and B3(ℬ ∪ {B′}) hold.

Proof of Theorem

Condition B1(ℬ ∪ {B′}) follows from B1(ℬ), the choice of B′bal, and the assumption about b. Condition B2(ℬ ∪ {B′}) follows from B2(ℬ), the choice of B′qrm, and the assumption about Q. If MaxVote(b, Q, ℬ)bal = −∞ then let B′dec be any decree, else let it equal MaxVote(b, Q, ℬ)dec. Condition B3(ℬ ∪ {B′}) then follows from B3(ℬ). End Proof of Theorem

The three rules, formally · and the proofs that they give consistency

Each ballot B has a number Bbal, a value Bdec, a quorum Bqrm and a set of voters Bvot, and ℬ is a set of ballots. The three rules are the conditions B1(ℬ), B2(ℬ) and B3(ℬ). A ballot is successful when Bqrm ⊆ Bvot.

To state B1(ℬ)–B3(ℬ) formally requires some more notation. A vote v was defined to be a quantity consisting of three components: a process vpst, a ballot number vbal, and a value vdec. It represents a vote cast by process vpst for value vdec in ballot number vbal. The authors also defined null votes to be votes v with vbal = −∞ and vdec = blank, where −∞ < b < ∞ for any ballot number b, and blank is not a value. For any process p, they defined nullp to be the unique null vote v with vpst = p.

the authors defined a total ordering on the set of all votes, but part of the manuscript containing the definition has been lost. The remaining fragment indicates that, for any votes v and v′, if vbal < v′bal then v < v′. It is not known how the relative order of v and v′ was defined if vbal = v′bal.

For any set ℬ of ballots, the set Votes(ℬ) of votes in ℬ was defined to consist of all votes v such that vpst ∈ Bvot, vbal = Bbal, and vdec = Bdec for some B ∈ ℬ. If p is a process and b is either a ballot number or ±∞, then MaxVote(b, p, ℬ) was defined to be the largest vote v in Votes(ℬ) cast by p with vbal < b, or to be nullp if there was no such vote. Since nullp is smaller than any real vote cast by p, this means that MaxVote(b, p, ℬ) is the largest vote in the set

{v ∈ Votes(ℬ) : (vpst = p) ∧ (vbal < b)} ∪ {nullp}

For any nonempty set Q of processes, MaxVote(b, Q, ℬ) was defined to equal the maximum of all votes MaxVote(b, p, ℬ) with p in Q.
Conditions B1(ℬ)–B3(ℬ) are stated formally as follows.8

B1(ℬ) ≜ ∀B, B′ ∈ ℬ : (B ≠ B′) ⇒ (Bbal ≠ B′bal)
B2(ℬ) ≜ ∀B, B′ ∈ ℬ : Bqrm ∩ B′qrm ≠ ∅
B3(ℬ) ≜ ∀B ∈ ℬ : (MaxVote(Bbal, Bqrm, ℬ)bal ≠ −∞) ⇒ (Bdec = MaxVote(Bbal, Bqrm, ℬ)dec)

Although the definition of MaxVote depends upon the ordering of votes, B1(ℬ) implies that MaxVote(b, Q, ℬ)dec is independent of how votes with equal ballot numbers were ordered.

8. I use the symbol ≜, which meant equals by definition.

To show that these conditions imply consistency, the authors first showed that B1(ℬ)–B3(ℬ) imply that, if a ballot B in ℬ is successful, then any later ballot in ℬ is for the same value as B.

Lemma

If B1(ℬ), B2(ℬ), and B3(ℬ) hold, then

((Bqrm ⊆ Bvot) ∧ (B′bal > Bbal)) ⇒ (B′dec = Bdec)

for any B, B′ in ℬ.

Proof of Lemma

For any ballot B in ℬ, let Ψ(B, ℬ) be the set of ballots in ℬ later than B for a value different from B’s:

Ψ(B, ℬ) ≜ {B′ ∈ ℬ : (B′bal > Bbal) ∧ (B′dec ≠ Bdec)}

To prove the lemma, it suffices to show that if Bqrm ⊆ Bvot then Ψ(B, ℬ) is empty. The authors gave a proof by contradiction. They assumed the existence of a B with Bqrm ⊆ Bvot and Ψ(B, ℬ) ≠ ∅, and obtained a contradiction as follows.9

  1. Choose C ∈ Ψ(B, ℬ) such that Cbal = min{B′bal : B′ ∈ Ψ(B, ℬ)}.
    Proof: C exists because Ψ(B, ℬ) is nonempty and finite.
  2. Cbal > Bbal
    Proof: By 1 and the definition of Ψ(B, ℬ).
  3. Bvot ∩ Cqrm ≠ ∅
    Proof: By B2(ℬ) and the hypothesis that Bqrm ⊆ Bvot.
  4. MaxVote(Cbal, Cqrm, ℬ)bal ≥ Bbal
    Proof: By 2, 3 and the definition of MaxVote(Cbal, Cqrm, ℬ).
  5. MaxVote(Cbal, Cqrm, ℬ) ∈ Votes(ℬ)
    Proof: By 4 (which implies that MaxVote(Cbal, Cqrm, ℬ) is not a null vote) and the definition of MaxVote(Cbal, Cqrm, ℬ).
  6. MaxVote(Cbal, Cqrm, ℬ)dec = Cdec.
    Proof: By 5 and B3(ℬ).
  7. MaxVote(Cbal, Cqrm, ℬ)dec ≠ Bdec
    Proof: By 6, 1, and the definition of Ψ(B, ℬ).
  8. MaxVote(Cbal, Cqrm, ℬ)bal > Bbal
    Proof: By 4, since 7 and B1(ℬ) imply that MaxVote(Cbal, Cqrm, ℬ)bal ≠ Bbal.
  9. MaxVote(Cbal, Cqrm, ℬ) ∈ Votes(Ψ(B, ℬ))
    Proof: By 7, 8, and the definition of Ψ(B, ℬ).
  10. MaxVote(Cbal, Cqrm, ℬ)bal < Cbal
    Proof: By definition of MaxVote(Cbal, Cqrm, ℬ).
  11. Contradiction
    Proof: By 9, 10, and 1.

End Proof of Lemma

9. the authors always provided careful, structured proofs of important theorems. They were not as sophisticated as modern mathematicians, who can omit many details and write paragraph-style proofs without ever making a mistake.

With this lemma, it was easy to show that, if B1–B3 hold, then any two successful ballots are for the same value.

Theorem 1

If B1(ℬ), B2(ℬ), and B3(ℬ) hold, then

((Bqrm ⊆ Bvot) ∧ (B′qrm ⊆ B′vot)) ⇒ (B′dec = Bdec)

for any B, B′ in ℬ.

Proof of Theorem

If B′bal = Bbal, then B1(ℬ) implies B′ = B. If B′bal ≠ Bbal, then the theorem follows immediately from the lemma. End Proof of Theorem

The authors then proved a theorem asserting that if there are enough processes in the system, then it is possible to conduct a successful ballot while preserving B1–B3. Although this does not guarantee progress, it at least shows that a balloting protocol based on B1–B3 will not deadlock.

Theorem 2

Let b be a ballot number and Q a set of processes such that b > Bbal and Q ∩ Bqrm ≠ ∅ for all B ∈ ℬ. If B1(ℬ), B2(ℬ), and B3(ℬ) hold, then there is a ballot B′ with B′bal = b and B′qrm = B′vot = Q such that B1(ℬ ∪ {B′}), B2(ℬ ∪ {B′}), and B3(ℬ ∪ {B′}) hold.

Proof of Theorem

Condition B1(ℬ ∪ {B′}) follows from B1(ℬ), the choice of B′bal, and the assumption about b. Condition B2(ℬ ∪ {B′}) follows from B2(ℬ), the choice of B′qrm, and the assumption about Q. If MaxVote(b, Q, ℬ)bal = −∞ then let B′dec be any value, else let it equal MaxVote(b, Q, ℬ)dec. Condition B3(ℬ ∪ {B′}) then follows from B3(ℬ). End Proof of Theorem

The rules as steps

One ballot, step by step

When a priest wants to get a decree chosen, they initiate a ballot, and the three rules dictate every step of the exchange. Notice one crucial detail: to satisfy Rule Three (proposing the latest vote cast by anyone in the quorum below ballot b), the initiator cannot allow a quorum member to tell them "my latest vote was in ballot 5" and then turn around a moment later and cast a vote in ballot 18! So before proposing anything, the initiator must ask each quorum member both for their latest vote and for a binding promise never to vote in any ballot numbered below b (Phase 1: Prepare / Promise), and only then ask them to vote on the chosen decree (Phase 2: Accept / Accepted). Scroll slowly to follow Priest Α running Ballot 27 among the five priests.When a process wants to get a value chosen, it initiates a ballot, and the three rules dictate every step of the exchange. Notice one crucial detail: to satisfy Rule Three (proposing the latest vote cast by anyone in the quorum below ballot b), the initiator cannot allow a quorum member to tell it "my latest vote was in ballot 5" and then turn around a moment later and cast a vote in ballot 18! So before proposing anything, the initiator must ask each quorum member both for its latest vote and for a binding promise never to vote in any ballot numbered below b (Phase 1: Prepare / Promise), and only then ask them to vote on the chosen value (Phase 2: Accept / Accepted). Scroll slowly to follow process P1 running ballot 27 among the five processes.

1 · Choose a ballot number

Pick a fresh number and a majority

Priest Α initiates a ballot. To guarantee Rule One, each priest owns their own slice of ballot numbers; Α picks Ballot 27, which has never been used, and aims for a majority quorum of three: Α, Γ, and Δ (while Β and Ε sit this ballot out).P1 initiates a ballot. To guarantee Rule One, each process owns its own slice of ballot numbers; P1 picks ballot 27, which has never been used, and aims for a majority quorum of three: P1, P3, and P4 (while P2 and P5 take no part in this ballot).

2 · Ask (NextBallot / Prepare)

A question coupled with a promise

Α sends a NextBallot(27) note to the quorum asking two things at once: "Tell me the highest-numbered vote you have ever cast prior to 27, and promise never to vote in any ballot numbered below 27."P1 sends a NextBallot(27) message to the quorum asking two things at once: "Tell me the highest-numbered vote you have ever cast prior to 27, and promise never to vote in any ballot numbered below 27."

3 · Promise (LastVote / Promise)

Each member records the promise and replies

Each member of the quorum writes the promise for Ballot 27 in the back of their scroll in indelible ink, and sends back a LastVote note reporting the highest-numbered vote they have ever cast (or blank if they have never voted).Each member of the quorum writes the promise for ballot 27 to stable storage, and sends back a LastVote message reporting the highest-numbered vote it has ever cast (or blank if it has never voted).

4 · Look back (Rule Three)

Α learns what the quorum voted forP1 learns what the quorum voted for

Because Α, Γ, and Δ have all promised never to vote in any ballot below 27, their answers freeze the history below 27! Γ reports voting for β in Ballot 5, Δ reports voting for α in Ballot 2, and Α has never voted. Since Ballot 5 is the highest-numbered vote among the three, Rule Three leaves Α no choice: Ballot 27 must propose decree β. (Α would be free to propose a brand-new decree only if no one in the quorum had ever voted.)Because P1, P3, and P4 have all promised never to vote in any ballot below 27, their answers freeze the history below 27! P3 reports voting for β in ballot 5, P4 reports voting for α in ballot 2, and P1 has never voted. Since ballot 5 is the highest-numbered vote among the three, Rule Three leaves P1 no choice: ballot 27 must propose value β. (P1 would be free to propose a brand-new value only if no one in the quorum had ever voted.)

5 · Propose (BeginBallot / Accept)

“Vote for decree β in Ballot 27”“Vote for value β in ballot 27”

Having fixed Ballot 27's decree to β, Α sends a BeginBallot(27, β) note to all three members of the quorum asking them to cast their votes.Having fixed ballot 27's value to β, P1 sends a BeginBallot(27, β) message to all three members of the quorum asking them to cast their votes.

6 · Vote (Voted / Accepted)

Vote unless a higher promise intervened

Each member of the quorum checks the back of their scroll: provided they have not promised to ignore Ballot 27 in favor of some even higher ballot in the meantime, they record their vote for (27, β) in indelible ink and send a Voted(27) note back to Α.Each member of the quorum checks its stable storage: provided it has not promised to ignore ballot 27 in favor of some even higher ballot in the meantime, it records its vote for (27, β) and sends a Voted(27) message back to P1.

7 · Done (Success)

All three voted, so the ballot succeeds

Once Α holds Voted(27) notes from the entire quorum {Α, Γ, Δ}, Ballot 27 has succeeded! Α writes decree β into the front of their scroll as the Synod's official decree and sends a Success(β) announcement to every priest.Once P1 holds Voted(27) messages from the entire quorum {P1, P3, P4}, ballot 27 has succeeded! P1 records value β as the chosen value and sends a Success(β) announcement to every process.

Notice that every step of this protocol is permissive: it specifies what a priest may do, never what a priest must do to keep the scrolls safe. If a priest walks out the door or a messenger vanishes at sea, a step simply remains unfinished, and an unfinished ballot can never violate any of the three rules. Likewise, if a forgetful messenger delivers the same note twice, the second delivery is harmlessly ignored. Consequently, no combination of departures, crashes, or message delays can ever cause two scrolls to disagree.Notice that every step of this protocol is permissive: it specifies what a process may do, never what a process must do to keep the logs safe. If a process stops or a message is lost, a step simply remains unfinished, and an unfinished ballot can never violate any of the three rules. Likewise, if the network delivers the same message twice, the second delivery is harmlessly ignored. Consequently, no combination of crashes, restarts, or message delays can ever cause two logs to disagree.

Appendix · proof of consistency of the Synod's protocol

The one-ballot protocol above, stated as the actions a priest may take, with the invariant those actions maintain and its proof.

A1 · The Basic Protocol

The Synod’s basic protocol, described informally above, is stated here using modern algorithmic notation. We begin with the variables that a priest p must maintain. First come the variables that represent information kept in his ledger. (For convenience, a priest's previous vote is kept as its two components prevBal[p] and prevDec[p].)

Ledger variables

outcome[p] — The decree written in p’s ledger, or blank if there is nothing written there yet.

lastTried[p] — The number of the last ballot that p tried to begin, or −∞ if there was none.

prevBal[p] — The number of the last ballot in which p voted, or −∞ if he never voted.

prevDec[p] — The decree for which p last voted, or blank if p never voted.

nextBal[p] — The number of the last ballot in which p agreed to participate, or −∞ if he has never agreed to participate in a ballot.

Next come variables representing information that priest p could keep on a slip of paper:

Slip-of-paper variables

status[p] — One of the following values:
  idle — Not conducting or trying to begin a ballot
  trying — Trying to begin ballot number lastTried[p]
  polling — Now conducting ballot number lastTried[p]
If p has lost his slip of paper, then status[p] is assumed to equal idle and the values of the following four variables are irrelevant.

prevVotes[p] — The set of votes received in LastVote messages for the current ballot (the one with ballot number lastTried[p]).

quorum[p] — If status[p] = polling, then the set of priests forming the quorum of the current ballot; otherwise, meaningless.

voters[p] — If status[p] = polling, then the set of quorum members from whom p has received Voted messages in the current ballot; otherwise, meaningless.

decree[p] — If status[p] = polling, then the decree of the current ballot; otherwise, meaningless.

There is also the history variable ℬ, which is the set of ballots that have been started and their progress—namely, which priests have cast votes. (A history variable is one used in the development and proof of an algorithm, but not actually implemented.)

Next come the actions that priest p may take. These actions are assumed to be atomic, meaning that once an action is begun, it must be completed before priest p begins any other action. An action is described by an enabling condition and a list of effects. The enabling condition describes when the action can be performed; actions that receive a message are enabled whenever a messenger has arrived with the appropriate message. The list of effects describes how the action changes the algorithm’s variables and what message, if any, it sends. (Each individual action sends at most one message.)

Recall that ballot numbers were partitioned among the priests. For any ballot number b, the Paxons defined owner(b) to be the priest who was allowed to use that ballot number.

The actions in the basic protocol are allowed actions; the protocol does not require that a priest ever do anything. No attempt at efficiency has been made; the actions allow p to do silly things, such as sending another BeginBallot message to a priest from whom he has already received a LastVote message.

The actions of the basic protocol

Try New Ballot
Always enabled.
– Set lastTried[p] to any ballot number b, greater than its previous value, such that owner(b) = p.
– Set status[p] to trying.
– Set prevVotes[p] to ∅.

Send NextBallot Message
Enabled whenever status[p] = trying.
– Send a NextBallot(lastTried[p]) message to any priest.

Receive NextBallot(b) Message
If b ≥ nextBal[p] then
– Set nextBal[p] to b.

Send LastVote Message
Enabled whenever nextBal[p] > prevBal[p].
– Send a LastVote(nextBal[p], v) message to priest owner(nextBal[p]), where vpst = p, vbal = prevBal[p], and vdec = prevDec[p].

Receive LastVote(b, v) Message
If b = lastTried[p] and status[p] = trying, then
– Set prevVotes[p] to the union of its original value and {v}.

Start Polling Majority Set Q
Enabled when status[p] = trying and Q ⊆ {vpst : v ∈ prevVotes[p]}, where Q is a majority set.
– Set status[p] to polling.
– Set quorum[p] to Q.
– Set voters[p] to ∅.
– Set decree[p] to a decree d chosen as follows: Let v be the maximum element of prevVotes[p]. If vbal ≠ −∞ then d = vdec, else d can equal any decree.
– Set ℬ to the union of its former value and {B}, where Bdec = d, Bqrm = Q, Bvot = ∅, and Bbal = lastTried[p].

Send BeginBallot Message
Enabled when status[p] = polling.
– Send a BeginBallot(lastTried[p], decree[p]) message to any priest in quorum[p].

Receive BeginBallot(b, d) Message
If b = nextBal[p] > prevBal[p] then
– Set prevBal[p] to b.
– Set prevDec[p] to d.
– If there is a ballot B in ℬ with Bbal = b [there will be], then choose any such B [there will be only one] and let the new value of ℬ be obtained from its old value by setting Bvot equal to the union of its old value and {p}.

Send Voted Message
Enabled whenever prevBal[p] ≠ −∞.
– Send a Voted(prevBal[p], p) message to owner(prevBal[p]).

Receive Voted(b, q) Message
If b = lastTried[p] and status[p] = polling, then
– Set voters[p] to the union of its old value and {q}

Succeed
Enabled whenever status[p] = polling, quorum[p] ⊆ voters[p], and outcome[p] = blank.
– Set outcome[p] to decree[p].

Send Success Message
Enabled whenever outcome[p] ≠ blank.
– Send a Success(outcome[p]) message to any priest.

Receive Success(d) Message
If outcome[p] = blank, then
– Set outcome[p] to d.

This algorithm is an abstract description of the real protocol performed by Paxon priests. Do the algorithm’s actions accurately model the actions of the real priests? There were three kinds of actions that a priest could perform “atomically”: receiving a message, writing a note or ledger entry, and sending a message. Each of these is represented by a single action of the algorithm, except that Receive actions both receive a message and set a variable. We can pretend that the receipt of a message occurred when a priest acted upon the message; if he left the Chamber before acting upon it, then we can pretend that the message was never received. Since this pretense does not affect the consistency condition, we can infer the consistency of the basic Synod protocol from the consistency of the algorithm.

A2 · Proof of Consistency

To prove the consistency condition, it is necessary to show that whenever outcome[p] and outcome[q] are both different from blank, they are equal. A rigorous correctness proof requires a complete description of the algorithm. The description given above is almost complete. Missing is a variable ℳ whose value is the multiset of all messages in transit.15 Each Send action adds a message to this multiset and each Receive action removes one. Also needed are actions to represent the loss and duplication of messages, as well as a Forget action that represents a priest losing his slip of paper.

With these additions, we get an algorithm that defines a set of possible behaviors, in which each change of state corresponds to one of the allowed actions. The Paxons proved correctness by finding a predicate I such that

  1. I is true initially.
  2. I implies the desired correctness condition.
  3. Each allowed action leaves I true.

The predicate I was written as a conjunction I1 ∧ ... ∧ I7, where I1–I5 were in turn the conjunction of predicates I1(p)–I5(p) for all priests p. Although most variables are mentioned in several of the conjuncts, each variable except status[p] is naturally associated with one conjunct, and each conjunct can be thought of as a constraint on its associated variables. The definitions of the individual conjuncts of I are given below, where a list of items marked by ∧ symbols denotes the conjunction of those items. The variables associated with a conjunct are listed in bracketed comments.

15. A multiset is a set that may contain multiple copies of the same element.

The invariant I, in full
I1(p) ≜ [Associated variable: outcome[p]]
(outcome[p] ≠ blank) ⇒ ∃B ∈ ℬ : (Bqrm ⊆ Bvot) ∧ (Bdec = outcome[p])
I2(p) ≜ [Associated variable: lastTried[p]]
∧ owner(lastTried[p]) = p
∧ ∀B ∈ ℬ : (owner(Bbal) = p) ⇒
    ∧ Bbal ≤ lastTried[p]
    ∧ (status[p] = trying) ⇒ (Bbal < lastTried[p])
I3(p) ≜ [Associated variables: prevBal[p], prevDec[p], nextBal[p]]
∧ prevBal[p] = MaxVote(∞, p, ℬ)bal
∧ prevDec[p] = MaxVote(∞, p, ℬ)dec
∧ nextBal[p] ≥ prevBal[p]
I4(p) ≜ [Associated variable: prevVotes[p]]
(status[p] ≠ idle) ⇒ ∀v ∈ prevVotes[p] :
    ∧ v = MaxVote(lastTried[p], vpst, ℬ)
    ∧ nextBal[vpst] ≥ lastTried[p]
I5(p) ≜ [Associated variables: quorum[p], voters[p], decree[p]]
(status[p] = polling) ⇒
    ∧ quorum[p] ⊆ {vpst : v ∈ prevVotes[p]}
    ∧ ∃B ∈ ℬ : ∧ quorum[p] = Bqrm ∧ decree[p] = Bdec
                  ∧ voters[p] ⊆ Bvot ∧ lastTried[p] = Bbal
I6 ≜ [Associated variable: ℬ]
∧ B1(ℬ) ∧ B2(ℬ) ∧ B3(ℬ)
∧ ∀B ∈ ℬ : Bqrm is a majority set
I7 ≜ [Associated variable: ℳ]
∧ ∀NextBallot(b) ∈ ℳ : (b ≤ lastTried[owner(b)])
∧ ∀LastVote(b, v) ∈ ℳ : ∧ v = MaxVote(b, vpst, ℬ) ∧ nextBal[vpst] ≥ b
∧ ∀BeginBallot(b, d) ∈ ℳ : ∃B ∈ ℬ : (Bbal = b) ∧ (Bdec = d)
∧ ∀Voted(b, p) ∈ ℳ : ∃B ∈ ℬ : (Bbal = b) ∧ (p ∈ Bvot)
∧ ∀Success(d) ∈ ℳ : ∃p : outcome[p] = d ≠ blank

The Paxons had to prove that I satisfies the three conditions given above. The first condition, that I holds initially, requires checking that each conjunct is true for the initial values of all the variables. While not stated explicitly, these initial values can be inferred from the variables’ descriptions, and checking the first condition is straightforward. The second condition, that I implies consistency, follows from I1, the first conjunct of I6, and Theorem 1. The hard part was proving the third condition, the invariance of I, which meant proving that I is left true by every action. This condition is proved by showing that, for each conjunct of I, executing any action when I is true leaves that conjunct true. The proofs are sketched below.

The proofs, conjunct by conjunct

I1(p) — ℬ is changed only by adding a new ballot or adding a new priest to Bvot for some B ∈ ℬ, neither of which can falsify I1(p). The value of outcome[p] is changed only by the Succeed and Receive Success Message actions. The enabling condition and I5(p) imply that I1(p) is left true by the Succeed action. The enabling condition, I1(p), and the last conjunct of I7 imply that I1(p) is left true by the Receive Success Message action.

I2(p) — This conjunct depends only on lastTried[p], status[p], and ℬ. Only the Try New Ballot action changes lastTried[p], and only that action can set status[p] to trying. Since the action increases lastTried[p] to a value b with owner(b) = p, it leaves I2(p) true. A completely new element is added to ℬ only by a Start Polling action; the first conjunct of I2(p) and the specification of the action imply that adding this new element does not falsify the second conjunct of I2(p). The only other way ℬ is changed is by adding a new priest to Bvot for some B ∈ ℬ, which does not affect I2(p).

I3(p) — Since votes are never removed from ℬ, the only action that can change MaxVote(∞, p, ℬ) is one that adds to ℬ a vote cast by p. Only a Receive BeginBallot Message action can do that, and only that action changes prevBal[p] and prevDec[p]. The BeginBallot conjunct of I7 implies that this action actually does add a vote to ℬ, and B1(ℬ) (the first conjunct of I6) implies that there is only one ballot to which the vote can be added. The enabling condition, the assumption that I3(p) holds before executing the action, and the definition of MaxVote then imply that the action leaves the first two conjuncts of I3(p) true. The third conjunct is left true because prevBal[p] is changed only by setting it to nextBal[p], and nextBal[p] is never decreased.

I4(p) — This conjunct depends only upon the values of status[p], prevVotes[p], lastTried[p], nextBal[q] for some priests q, and ℬ. The value of status[p] is changed from idle to not idle only by a Try New Ballot action, which sets prevVotes[p] to ∅, making I4(p) vacuously true. The only other actions that change prevVotes[p] are the Forget action, which leaves I4(p) true because it sets status[p] to idle, and the Receive LastVote Message action. It follows from the enabling condition and the LastVote conjunct of I7 that the Receive LastVote Message action preserves I4(p). The value of lastTried[p] is changed only by the Try New Ballot action, which leaves I4(p) true because it sets status[p] to trying. The value of nextBal[q] can only increase, which cannot make I4(p) false. Finally, MaxVote(lastTried[p], vpst, ℬ) can be changed only if vpst is added to Bvot for some B ∈ ℬ with Bbal < lastTried[p]. But vpst is added to Bvot (by a Receive BeginBallot Message action) only if nextBal[vpst] = Bbal, in which case I4(p) implies that Bbal ≥ lastTried[p].

I5(p) — The value of status[p] is set to polling only by the Start Polling action. This action’s enabling condition guarantees that the first conjunct becomes true, and it adds the ballot to ℬ that makes the second conjunct true. No other action changes quorum[p], decree[p], or lastTried[p] while leaving status[p] equal to polling. The value of prevVotes[p] cannot be changed while status[p] = polling, and ℬ is changed only by adding new elements or by adding a new priest to Bvot. The only remaining possibility for falsifying I5(p) is the addition of a new element to voters[p] by the Receive Voted Message action. The Voted conjunct of I7, B1(ℬ) (the first conjunct of I6), and the action’s enabling condition imply that the element added to voters[p] is in Bvot, where B is the ballot whose existence is asserted in I5(p).

I6 — Since Bbal and Bqrm are never changed for any B ∈ ℬ, the only way B1(ℬ), B2(ℬ), and the second conjunct of I6 can be falsified is by adding a new ballot to ℬ, which is done only by the Start Polling Majority Set Q action when status[p] equals trying. It follows from the second conjunct of I2(p) that this action leaves B1(ℬ) true; and the assertion, in the enabling condition, that Q is a majority set implies that the action leaves B2(ℬ) and the second conjunct of I6 true. There are two possible ways of falsifying B3(ℬ): changing MaxVote(Bbal, Bqrm, ℬ) by adding a new vote to ℬ, and adding a new ballot to ℬ. A new vote is added only by the Receive BeginBallot Message action, and I3(p) implies that the action adds a vote later than any other vote cast by p in ℬ, so it cannot change MaxVote(Bbal, Bqrm, ℬ) for any B in ℬ. Conjunct I4(p) implies that the new ballot added by the Start Polling action does not falsify B3(ℬ).

I7 — I7 can be falsified either by adding a new message to ℳ or by changing the value of another variable on which I7 depends. Since lastTried[p] and nextBal[p] are never decreased, changing them cannot make I7 false. Since outcome[p] is never changed if its value is not blank, changing it cannot falsify I7. Since ℬ is changed only by adding ballots and adding votes, the only change to it that can make I7 false is the addition of a vote by vpst that makes the LastVote(b, v) conjunct false by changing MaxVote(b, vpst, ℬ). This can happen only if vpst votes in a ballot B with Bbal < b. But vpst can vote only in ballot number nextBal[vpst], and the assumption that this conjunct holds initially implies that nextBal[vpst] ≥ b. Therefore, we need check only that every message that is sent satisfies the condition in the appropriate conjunct of I7.

NextBallot: Follows from the definition of the Send NextBallot Message action and the first conjunct of I2(p).

LastVote: The enabling condition of the Send LastVote Message action and I3(p) imply that MaxVote(nextBal[p], p, ℬ) = MaxVote(∞, p, ℬ), from which it follows that the LastVote message sent by the action satisfies the condition in I7.

BeginBallot: Follows from I5(p) and the definition of the Send BeginBallot Message action.

Voted: Follows from I3(p), the definition of MaxVote, and the definition of the Send Voted Message action.

Success: Follows from the definition of Send Success Message.

Appendix · proof of consistency of the protocol

The one-ballot protocol above, stated as the actions a process may take, with the invariant those actions maintain and its proof.

A1 · The Basic Protocol

The Synod’s basic protocol, described informally above, is stated here using modern algorithmic notation. We begin with the variables that a process p must maintain. First come the variables that represent information kept in its stable storage. (For convenience, a process's previous vote is kept as its two components prevBal[p] and prevDec[p].)

Ledger variables

outcome[p] — The value written in p’s stable storage, or blank if there is nothing written there yet.

lastTried[p] — The number of the last ballot that p tried to begin, or −∞ if there was none.

prevBal[p] — The number of the last ballot in which p voted, or −∞ if it never voted.

prevDec[p] — The value for which p last voted, or blank if p never voted.

nextBal[p] — The number of the last ballot in which p agreed to participate, or −∞ if it has never agreed to participate in a ballot.

Next come variables representing information that process p could keep on a volatile memory:

Slip-of-paper variables

status[p] — One of the following values:
  idle — Not conducting or trying to begin a ballot
  trying — Trying to begin ballot number lastTried[p]
  polling — Now conducting ballot number lastTried[p]
If p has lost its volatile memory, then status[p] is assumed to equal idle and the values of the following four variables are irrelevant.

prevVotes[p] — The set of votes received in LastVote messages for the current ballot (the one with ballot number lastTried[p]).

quorum[p] — If status[p] = polling, then the set of processes forming the quorum of the current ballot; otherwise, meaningless.

voters[p] — If status[p] = polling, then the set of quorum members from whom p has received Voted messages in the current ballot; otherwise, meaningless.

value[p] — If status[p] = polling, then the value of the current ballot; otherwise, meaningless.

There is also the history variable ℬ, which is the set of ballots that have been started and their progress—namely, which processes have cast votes. (A history variable is one used in the development and proof of an algorithm, but not actually implemented.)

Next come the actions that process p may take. These actions are assumed to be atomic, meaning that once an action is begun, it must be completed before process p begins any other action. An action is described by an enabling condition and a list of effects. The enabling condition describes when the action can be performed; actions that receive a message are enabled whenever a messenger has arrived with the appropriate message. The list of effects describes how the action changes the algorithm’s variables and what message, if any, it sends. (Each individual action sends at most one message.)

Recall that ballot numbers were partitioned among the processes. For any ballot number b, the authors defined owner(b) to be the process who was allowed to use that ballot number.

The actions in the basic protocol are allowed actions; the protocol does not require that a process ever do anything. No attempt at efficiency has been made; the actions allow p to do silly things, such as sending another BeginBallot message to a process from whom it has already received a LastVote message.

The actions of the basic protocol

Try New Ballot
Always enabled.
– Set lastTried[p] to any ballot number b, greater than its previous value, such that owner(b) = p.
– Set status[p] to trying.
– Set prevVotes[p] to ∅.

Send NextBallot Message
Enabled whenever status[p] = trying.
– Send a NextBallot(lastTried[p]) message to any process.

Receive NextBallot(b) Message
If b ≥ nextBal[p] then
– Set nextBal[p] to b.

Send LastVote Message
Enabled whenever nextBal[p] > prevBal[p].
– Send a LastVote(nextBal[p], v) message to process owner(nextBal[p]), where vpst = p, vbal = prevBal[p], and vdec = prevDec[p].

Receive LastVote(b, v) Message
If b = lastTried[p] and status[p] = trying, then
– Set prevVotes[p] to the union of its original value and {v}.

Start Polling Majority Set Q
Enabled when status[p] = trying and Q ⊆ {vpst : v ∈ prevVotes[p]}, where Q is a majority set.
– Set status[p] to polling.
– Set quorum[p] to Q.
– Set voters[p] to ∅.
– Set value[p] to a value d chosen as follows: Let v be the maximum element of prevVotes[p]. If vbal ≠ −∞ then d = vdec, else d can equal any value.
– Set ℬ to the union of its former value and {B}, where Bdec = d, Bqrm = Q, Bvot = ∅, and Bbal = lastTried[p].

Send BeginBallot Message
Enabled when status[p] = polling.
– Send a BeginBallot(lastTried[p], value[p]) message to any process in quorum[p].

Receive BeginBallot(b, d) Message
If b = nextBal[p] > prevBal[p] then
– Set prevBal[p] to b.
– Set prevDec[p] to d.
– If there is a ballot B in ℬ with Bbal = b [there will be], then choose any such B [there will be only one] and let the new value of ℬ be obtained from its old value by setting Bvot equal to the union of its old value and {p}.

Send Voted Message
Enabled whenever prevBal[p] ≠ −∞.
– Send a Voted(prevBal[p], p) message to owner(prevBal[p]).

Receive Voted(b, q) Message
If b = lastTried[p] and status[p] = polling, then
– Set voters[p] to the union of its old value and {q}

Succeed
Enabled whenever status[p] = polling, quorum[p] ⊆ voters[p], and outcome[p] = blank.
– Set outcome[p] to value[p].

Send Success Message
Enabled whenever outcome[p] ≠ blank.
– Send a Success(outcome[p]) message to any process.

Receive Success(d) Message
If outcome[p] = blank, then
– Set outcome[p] to d.

This algorithm is an abstract description of the real protocol performed by processes. Do the algorithm’s actions accurately model the actions of the real processes? There were three kinds of actions that a process could perform “atomically”: receiving a message, writing a note or stable storage entry, and sending a message. Each of these is represented by a single action of the algorithm, except that Receive actions both receive a message and set a variable. We can pretend that the receipt of a message occurred when a process acted upon the message; if it left the system before acting upon it, then we can pretend that the message was never received. Since this pretense does not affect the consistency condition, we can infer the consistency of the basic Synod protocol from the consistency of the algorithm.

A2 · Proof of Consistency

To prove the consistency condition, it is necessary to show that whenever outcome[p] and outcome[q] are both different from blank, they are equal. A rigorous correctness proof requires a complete description of the algorithm. The description given above is almost complete. Missing is a variable ℳ whose value is the multiset of all messages in transit.15 Each Send action adds a message to this multiset and each Receive action removes one. Also needed are actions to represent the loss and duplication of messages, as well as a Forget action that represents a process losing its volatile memory.

With these additions, we get an algorithm that defines a set of possible behaviors, in which each change of state corresponds to one of the allowed actions. The authors proved correctness by finding a predicate I such that

  1. I is true initially.
  2. I implies the desired correctness condition.
  3. Each allowed action leaves I true.

The predicate I was written as a conjunction I1 ∧ ... ∧ I7, where I1–I5 were in turn the conjunction of predicates I1(p)–I5(p) for all processes p. Although most variables are mentioned in several of the conjuncts, each variable except status[p] is naturally associated with one conjunct, and each conjunct can be thought of as a constraint on its associated variables. The definitions of the individual conjuncts of I are given below, where a list of items marked by ∧ symbols denotes the conjunction of those items. The variables associated with a conjunct are listed in bracketed comments.

15. A multiset is a set that may contain multiple copies of the same element.

The invariant I, in full
I1(p) ≜ [Associated variable: outcome[p]]
(outcome[p] ≠ blank) ⇒ ∃B ∈ ℬ : (Bqrm ⊆ Bvot) ∧ (Bdec = outcome[p])
I2(p) ≜ [Associated variable: lastTried[p]]
∧ owner(lastTried[p]) = p
∧ ∀B ∈ ℬ : (owner(Bbal) = p) ⇒
    ∧ Bbal ≤ lastTried[p]
    ∧ (status[p] = trying) ⇒ (Bbal < lastTried[p])
I3(p) ≜ [Associated variables: prevBal[p], prevDec[p], nextBal[p]]
∧ prevBal[p] = MaxVote(∞, p, ℬ)bal
∧ prevDec[p] = MaxVote(∞, p, ℬ)dec
∧ nextBal[p] ≥ prevBal[p]
I4(p) ≜ [Associated variable: prevVotes[p]]
(status[p] ≠ idle) ⇒ ∀v ∈ prevVotes[p] :
    ∧ v = MaxVote(lastTried[p], vpst, ℬ)
    ∧ nextBal[vpst] ≥ lastTried[p]
I5(p) ≜ [Associated variables: quorum[p], voters[p], value[p]]
(status[p] = polling) ⇒
    ∧ quorum[p] ⊆ {vpst : v ∈ prevVotes[p]}
    ∧ ∃B ∈ ℬ : ∧ quorum[p] = Bqrm ∧ value[p] = Bdec
                  ∧ voters[p] ⊆ Bvot ∧ lastTried[p] = Bbal
I6 ≜ [Associated variable: ℬ]
∧ B1(ℬ) ∧ B2(ℬ) ∧ B3(ℬ)
∧ ∀B ∈ ℬ : Bqrm is a majority set
I7 ≜ [Associated variable: ℳ]
∧ ∀NextBallot(b) ∈ ℳ : (b ≤ lastTried[owner(b)])
∧ ∀LastVote(b, v) ∈ ℳ : ∧ v = MaxVote(b, vpst, ℬ) ∧ nextBal[vpst] ≥ b
∧ ∀BeginBallot(b, d) ∈ ℳ : ∃B ∈ ℬ : (Bbal = b) ∧ (Bdec = d)
∧ ∀Voted(b, p) ∈ ℳ : ∃B ∈ ℬ : (Bbal = b) ∧ (p ∈ Bvot)
∧ ∀Success(d) ∈ ℳ : ∃p : outcome[p] = d ≠ blank

The authors had to prove that I satisfies the three conditions given above. The first condition, that I holds initially, requires checking that each conjunct is true for the initial values of all the variables. While not stated explicitly, these initial values can be inferred from the variables’ descriptions, and checking the first condition is straightforward. The second condition, that I implies consistency, follows from I1, the first conjunct of I6, and Theorem 1. The hard part was proving the third condition, the invariance of I, which meant proving that I is left true by every action. This condition is proved by showing that, for each conjunct of I, executing any action when I is true leaves that conjunct true. The proofs are sketched below.

The proofs, conjunct by conjunct

I1(p) — ℬ is changed only by adding a new ballot or adding a new process to Bvot for some B ∈ ℬ, neither of which can falsify I1(p). The value of outcome[p] is changed only by the Succeed and Receive Success Message actions. The enabling condition and I5(p) imply that I1(p) is left true by the Succeed action. The enabling condition, I1(p), and the last conjunct of I7 imply that I1(p) is left true by the Receive Success Message action.

I2(p) — This conjunct depends only on lastTried[p], status[p], and ℬ. Only the Try New Ballot action changes lastTried[p], and only that action can set status[p] to trying. Since the action increases lastTried[p] to a value b with owner(b) = p, it leaves I2(p) true. A completely new element is added to ℬ only by a Start Polling action; the first conjunct of I2(p) and the specification of the action imply that adding this new element does not falsify the second conjunct of I2(p). The only other way ℬ is changed is by adding a new process to Bvot for some B ∈ ℬ, which does not affect I2(p).

I3(p) — Since votes are never removed from ℬ, the only action that can change MaxVote(∞, p, ℬ) is one that adds to ℬ a vote cast by p. Only a Receive BeginBallot Message action can do that, and only that action changes prevBal[p] and prevDec[p]. The BeginBallot conjunct of I7 implies that this action actually does add a vote to ℬ, and B1(ℬ) (the first conjunct of I6) implies that there is only one ballot to which the vote can be added. The enabling condition, the assumption that I3(p) holds before executing the action, and the definition of MaxVote then imply that the action leaves the first two conjuncts of I3(p) true. The third conjunct is left true because prevBal[p] is changed only by setting it to nextBal[p], and nextBal[p] is never decreased.

I4(p) — This conjunct depends only upon the values of status[p], prevVotes[p], lastTried[p], nextBal[q] for some processes q, and ℬ. The value of status[p] is changed from idle to not idle only by a Try New Ballot action, which sets prevVotes[p] to ∅, making I4(p) vacuously true. The only other actions that change prevVotes[p] are the Forget action, which leaves I4(p) true because it sets status[p] to idle, and the Receive LastVote Message action. It follows from the enabling condition and the LastVote conjunct of I7 that the Receive LastVote Message action preserves I4(p). The value of lastTried[p] is changed only by the Try New Ballot action, which leaves I4(p) true because it sets status[p] to trying. The value of nextBal[q] can only increase, which cannot make I4(p) false. Finally, MaxVote(lastTried[p], vpst, ℬ) can be changed only if vpst is added to Bvot for some B ∈ ℬ with Bbal < lastTried[p]. But vpst is added to Bvot (by a Receive BeginBallot Message action) only if nextBal[vpst] = Bbal, in which case I4(p) implies that Bbal ≥ lastTried[p].

I5(p) — The value of status[p] is set to polling only by the Start Polling action. This action’s enabling condition guarantees that the first conjunct becomes true, and it adds the ballot to ℬ that makes the second conjunct true. No other action changes quorum[p], value[p], or lastTried[p] while leaving status[p] equal to polling. The value of prevVotes[p] cannot be changed while status[p] = polling, and ℬ is changed only by adding new elements or by adding a new process to Bvot. The only remaining possibility for falsifying I5(p) is the addition of a new element to voters[p] by the Receive Voted Message action. The Voted conjunct of I7, B1(ℬ) (the first conjunct of I6), and the action’s enabling condition imply that the element added to voters[p] is in Bvot, where B is the ballot whose existence is asserted in I5(p).

I6 — Since Bbal and Bqrm are never changed for any B ∈ ℬ, the only way B1(ℬ), B2(ℬ), and the second conjunct of I6 can be falsified is by adding a new ballot to ℬ, which is done only by the Start Polling Majority Set Q action when status[p] equals trying. It follows from the second conjunct of I2(p) that this action leaves B1(ℬ) true; and the assertion, in the enabling condition, that Q is a majority set implies that the action leaves B2(ℬ) and the second conjunct of I6 true. There are two possible ways of falsifying B3(ℬ): changing MaxVote(Bbal, Bqrm, ℬ) by adding a new vote to ℬ, and adding a new ballot to ℬ. A new vote is added only by the Receive BeginBallot Message action, and I3(p) implies that the action adds a vote later than any other vote cast by p in ℬ, so it cannot change MaxVote(Bbal, Bqrm, ℬ) for any B in ℬ. Conjunct I4(p) implies that the new ballot added by the Start Polling action does not falsify B3(ℬ).

I7 — I7 can be falsified either by adding a new message to ℳ or by changing the value of another variable on which I7 depends. Since lastTried[p] and nextBal[p] are never decreased, changing them cannot make I7 false. Since outcome[p] is never changed if its value is not blank, changing it cannot falsify I7. Since ℬ is changed only by adding ballots and adding votes, the only change to it that can make I7 false is the addition of a vote by vpst that makes the LastVote(b, v) conjunct false by changing MaxVote(b, vpst, ℬ). This can happen only if vpst votes in a ballot B with Bbal < b. But vpst can vote only in ballot number nextBal[vpst], and the assumption that this conjunct holds initially implies that nextBal[vpst] ≥ b. Therefore, we need check only that every message that is sent satisfies the condition in the appropriate conjunct of I7.

NextBallot: Follows from the definition of the Send NextBallot Message action and the first conjunct of I2(p).

LastVote: The enabling condition of the Send LastVote Message action and I3(p) imply that MaxVote(nextBal[p], p, ℬ) = MaxVote(∞, p, ℬ), from which it follows that the LastVote message sent by the action satisfies the condition in I7.

BeginBallot: Follows from I5(p) and the definition of the Send BeginBallot Message action.

Voted: Follows from I3(p), the definition of MaxVote, and the definition of the Send Voted Message action.

Success: Follows from the definition of Send Success Message.

Safe is not enough

Too many ballots block everything

The basic ballot rules guarantee that the scrolls never disagree, but they do not guarantee that a decree is ever chosen. If no priest starts a ballot, nothing happens; and if two priests start ballots at the same time, they can trip each other up forever (dueling proposers).The basic ballot rules guarantee that the logs never disagree, but they do not guarantee that a value is ever chosen. If no process starts a ballot, nothing happens; and if two processes start ballots at the same time, they can trip each other up forever (dueling proposers).

The snag lies in the Phase 1 promise. Whenever a priest starts a higher-numbered ballot, its quorum promises never to vote in any lower-numbered ballot, which kills the earlier ballot if it has not yet finished Phase 2! If two eager priests both try to drive a ballot at once, each can keep interrupting the other with a higher ballot number before the other's Phase 2 votes come in:The snag lies in the Phase 1 promise. Whenever a process starts a higher-numbered ballot, its quorum promises never to vote in any lower-numbered ballot, which kills the earlier ballot if it has not yet finished Phase 2! If two competing processes both try to drive a ballot at once, each can keep interrupting the other with a higher ballot number before the other's Phase 2 votes come in:

Two would-be presidentsTwo would-be leaders no one is in charge

0decrees passedvalues decided
0highest ballot started

The Paxons' cure was to elect a single president (a distinguished proposer or leader) who alone initiates ballots while in the Chamber. In most political systems, electing a president is perilous because if two people simultaneously think they are president, the government can issue contradictory laws. In Paxos, having two simultaneous presidents can only slow things down: it can never cause two scrolls to disagree, because safety does not depend on having a single leader! And as soon as a majority of priests remain in the Chamber for long enough, their sandglasses let them agree on a single president who completes a ballot without interruption.The cure is to elect a single leader (a distinguished proposer) who alone initiates ballots. In most systems, electing a leader is perilous because if two processes simultaneously think they are the leader, the system can issue contradictory results. In Paxos, having two simultaneous leaders can only slow things down: it can never cause two logs to disagree, because safety does not depend on having a single leader! And as soon as a majority of processes stay up for long enough, they can agree on a single leader who completes a ballot without interruption.

From one decree to a whole lawFrom one value to a whole log

A separate Synod for every numberA separate instance for every slot

Where the ancient Synod chose only a single decree, the Paxon Parliament must pass a continuous sequence of numbered decrees (Decree 1, Decree 2, Decree 3, …). Its key insight is simple: treat each decree number as a separate instance of the Synod protocol, and let a single president coordinate all of them at once (Multi-Paxos).Where single-decree Paxos chooses only one value, the group must decide a continuous sequence of numbered values (slot 1, slot 2, slot 3, …). Its key insight is simple: treat each slot as a separate instance of the protocol, and let a single leader coordinate all of them at once (Multi-Paxos).

Inside the Chamber, a scholar on a bench copies decrees from one scroll onto another while two legislators and a messenger stand before him, between two columns

Whenever a citizen wants a decree passed, they hand it to the current president, who assigns it the next available decree number and runs a ballot for that number. Here comes the crucial optimization that makes Multi-Paxos fast: notice that Phase 1 of a ballot (NextBallot / LastVote) does not mention any specific decree! Because the president does not pick a decree until after the quorum replies, a newly elected president can send a single Phase 1 message covering every open decree number from the present into the future at once.Whenever a client wants a value decided, it hands it to the current leader, who assigns it the next available slot and runs a ballot for that slot. Here comes the crucial optimization that makes Multi-Paxos fast: notice that Phase 1 of a ballot (NextBallot / LastVote) does not mention any specific value! Because the leader does not pick a value until after the quorum replies, a newly elected leader can send a single Phase 1 message covering every open slot from the present into the future at once.

What comes back in those Phase 1 replies is best seen on a Monday morning, after legislators have been coming and going all weekend. Step through the three buttons below to see how the new president cleans up unfinished business and then passes new decrees in a single round-trip:What comes back in those Phase 1 replies is best seen after a weekend of crashes and restarts. Step through the three buttons below to see how the new leader cleans up unfinished business and then decides new values in a single round-trip:

The president's scrollThe leader's log newly appointed

Decrees 122 to 124 are known to everyone. Press the first button.Slots 122 to 124 are decided everywhere. Press the first button.

Notice how the new president closes any gap left behind in the numbering (such as slot 125 above, where no one in the quorum had voted, while slot 126 already held a vote): the president passes the ceremonial no-op decree "Traditional Olive Day" in slot 125 so that the law scroll has no missing numbers! And as long as the same president stays in office, Phase 1 never needs to be repeated: every subsequent decree takes just Phase 2 (BeginBallot and Voted) plus the Success announcement.Notice how the new leader closes any gap left behind in the numbering (such as slot 125 above, where no one in the quorum had voted, while slot 126 already held a vote): the leader decides a harmless no-op value in slot 125 so that the log has no missing slots! And as long as the same leader stays in office, Phase 1 never needs to be repeated: every subsequent value takes just Phase 2 (BeginBallot and Voted) plus the Success announcement.

Years of practice

Governing the island asked for moreRunning it for real asked for more

Turning a sequence of decrees into a working government for Paxos taught the islanders several practical lessons about distributed systems. Three famous incidents each refined how Parliament operated:Turning a sequence of decided values into a working system taught several practical lessons about distributed systems. Three famous incidents each refined how the protocol operated:

Inside the Chamber, a scholar on a bench copies decrees from one scroll onto another while two legislators and a messenger stand before him, between two columns

Choosing caught-up presidentsChoosing a caught-up leader

At first, the presidency went automatically to whoever in the Chamber stood last in the alphabet. When the legislator Ωκι returned from a six-month voyage, he immediately became president, and all new laws ground to a halt while he spent days copying six months of past decrees into his scroll. Preferring a president whose scroll is already up to date avoids that stall.At first, leadership went automatically to whichever process had the highest identifier. When a process came back after six months down, it immediately became leader, and all new values ground to a halt while it spent days copying six months of past decisions into its log. Preferring a leader whose log is already up to date avoids that stall.

On the quay by the market, among amphorae and baskets, two inspectors give opposite verdicts on wheels of pale cheese, one raising his hand in approval, one pointing and frowning, while merchants and a goatherd look on

One office, one holder (leases)One role, one holder (leases)

Parliament once passed a decree replacing a notoriously strict cheese inspector (Δ˘ικστρα) with a new one (Γωυδα). Because the old inspector did not hear of the decree for weeks, two inspectors roamed the market giving conflicting verdicts on the same cheese. Thereafter, every appointment ran for a bounded time lease, stamped with the time the decree was proposed, so a replacement could take office only after the previous holder's lease expired.A decision once replaced the holder of a role with a new one. Because the old holder did not learn of the decision for weeks, two holders gave conflicting rulings at the same time. Thereafter, every appointment ran for a bounded-time lease, stamped with the time the value was proposed, so a replacement could take over only after the previous holder's lease expired.

On a country road among scrub and cypresses, a merchant talks to a legislator who looks down at his open scroll, while a goatherd waits beside them with three shaggy black goats

Never trust a single stale scrollNever trust a single stale log

After Decree 77 legalized the sale of black goats, a farmer offered black goats to a merchant. The merchant checked with a legislator whose scroll only went up to Decree 76 and was wrongly told the sale was still illegal! To guarantee linearizable reads,* an inquiry about the current law must either go through a ballot or be answered by a lease-holding president whose scroll is guaranteed to be current.After slot 77 decided that a feature flag was now enabled, a client asked a process whose log only went up to slot 76 and was wrongly told the flag was still disabled! To guarantee linearizable reads,* a query about the current state must either go through a ballot or be answered by a lease-holding leader whose log is guaranteed to be current.

Two final refinements, log compaction and changing the membership of Parliament itself, required no new machinery at all:Two final refinements, log compaction and changing the group's membership itself, required no new machinery at all:

Scrolls grew too long fold one (checkpoints)Logs grew too long fold one (checkpoints)

Current law + number of the last decreeCurrent state + number of the last slot

As hundreds of decrees piled up, finding the current olive tax meant reading through years of superseded tax changes. So legislators replaced the long prefix of their scrolls with a compact summary of the current state of the law plus the number of the last decree folded into it (a snapshot or checkpoint).As hundreds of values piled up, finding the current state meant replaying years of superseded changes. So processes replace the long prefix of their logs with a compact summary of the current state plus the number of the last slot folded into it (a snapshot or checkpoint).

Membership by decree and self-healing scrollsMembership by decision and self-healing logs

Who sits in Parliament can be changed without two different groups thinking they are the majority, by making the membership roster part of the law itself, updated by ordinary decrees. To keep a ballot's quorum definition from shifting mid-vote, Decree n simply takes effect for the membership of Decree n + 3 and beyond.Who is in the group can be changed without two different groups thinking they are the majority, by making the membership roster part of the log itself, updated by ordinary values. To keep a ballot's quorum definition from shifting mid-vote, a change decided in slot n simply takes effect for the membership of slot n + 3 and beyond.

And by periodically re-passing summaries of the law as new decrees, even a scroll smudged by an accidental spill is eventually healed.And by periodically re-deciding summaries of the state as new values, even a log damaged by an accidental fault is eventually healed.

Why one office has one holder

A decree carries the time it was proposed. That is safe because of a causal ordering property of the parliamentary protocol, stated here with its proof.

If two decrees are passed by different presidents, then one of the presidents proposed his decree after learning that the other decree had been proposed.

Why the property holds

To see that this property is satisfied, suppose that ballot number b was successful for decree D, ballot number b′ was successful for decree D′, and b < b′. Let q be a legislator who voted in both ballots. The balloting for D′ began with a NextBallot(b′, n) message. If the sender of that message did not already know about D, then n is less than the decree number of D, and q’s reply to the NextBallot message must state that he voted for D.

Why one role has one holder

A value carries the time it was proposed. That is safe because of a causal ordering property of the parliamentary protocol, stated here with its proof.

If two values are passed by different presidents, then one of the presidents proposed its value after learning that the other value had been proposed.

Why the property holds

To see that this property is satisfied, suppose that ballot number b was successful for value D, ballot number b′ was successful for value D′, and b < b′. Let q be a process who voted in both ballots. The balloting for D′ began with a NextBallot(b′, n) message. If the sender of that message did not already know about D, then n is less than the value number of D, and q’s reply to the NextBallot message must state that it voted for D.

The protocol never lets two logs disagree, no matter how machines crash, restart, or drop messages.

It makes progress whenever a majority of machines are up and able to communicate for long enough, never sacrificing safety, and requiring stability only for progress.

Its ballot protocol lives on as Paxos.

Setting Part-Time Legislators Passing Laws

The paper and its references

Leslie Lamport, “The Part-Time Parliament,” ACM Transactions on Computer Systems 16, 2 (May 1998), 133–169. Submitted in January 1990 and accepted in March 1998: the referees offered to publish the paper if Lamport removed the Paxon allegory, Lamport declined to change it, and the manuscript sat in a drawer for eight years before finally appearing in print — followed in 2001 by “Paxos Made Simple.”

  1. Bernstein, P. A., Hadzilacos, V., and Goodman, N. 1987. Concurrency Control and Recovery in Database Systems. Addison-Wesley, Reading, Massachusetts.
  2. De Prisco, R., Lampson, B., and Lynch, N. 1997. Revisiting the Paxos algorithm. In M. Mavronicolas and P. Tsigas (Eds.), Proceedings of the 11th International Workshop on Distributed Algorithms (WDAG 97), Volume 1320 of Lecture Notes in Computer Science, Saarbruken, Germany, pp. 111–125. Springer-Verlag.
  3. Dijkstra, E. W. 1974. Self-stabilizing systems in spite of distributed control. Commun. ACM 17, 11 (Nov.), 643–644.
  4. Dwork, C., Lynch, N., and Stockmeyer, L. 1988. Consensus in the presence of partial synchrony. Journal of the ACM 35, 2 (April), 288–323.
  5. Fekete, A., Lynch, N., and Shvartsman, A. 1997. Specifying and using a partitionable group communication service. In Proceedings of the Sixteenth Annual ACM Symposium on Principles of Distributed Computing, pp. 53–62. ACM Press.
  6. Fischer, M. J., Lynch, N., and Paterson, M. S. 1985. Impossibility of distributed consensus with one faulty process. Journal of the ACM 32, 2 (April), 374–382.
  7. Gray, C. G. and Cheriton, D. R. 1989. Leases: An efficient fault-toerant mechanism for distributed file cache consistency. In Proceedings of the Twelfth ACM Symposium on Operating Systems Principles, New York, pp. 202–210. ACM.
  8. Keidar, I. and Dolev, D. 1996. Efficient message ordering in dynamic networks. In Proceedings of the 15th Annual ACM Symposium on Principles of Distributed Computing. ACM.
  9. Ladin, R., Liskov, B., Shrira, L., and Ghemawat, S. 1992. Providing high availability using lazy replication. ACM Transactions on Computer Systems 10, 4 (Nov.), 360–391.
  10. Lamport, L. 1978. Time, clocks, and the ordering of events in a distributed system. Commun. ACM 21, 7 (July), 558–565.
  11. Lamport, L. 1984. Using time instead of timeout for fault-tolerant distributed systems. ACM Trans. on Programm. Lang. Syst. 6, 2 (April), 254–280.
  12. Lampson, B. W. 1996. How to build a highly available system using consensus. In O. Babaoglu and K. Marzullo (Eds.), Distributed Algorithms, Volume 1151 of Lecture Notes in Computer Science, Berlin, pp. 1–17. Springer-Verlag.
  13. Oki, B. M. and Liskov, B. H. 1988. Viewstamped replication: A new primary copy method to support highly-available distributed systems. In Proceedings of the Seventh Annual ACM Symposium on Principles of Distributed Computing, pp. 8–17. ACM Press.
  14. Schneider, F. B. 1990. Implementing fault-tolerant services using the state machine approach: A tutorial. ACM Computing Surveys 22, 4 (Dec.), 299–319.
  15. Skeen, M. D. 1982. Crash recovery in a distributed database system. Ph. D. thesis, University of California, Berkeley.
Who was who on Paxos

The paper gives its Paxons the names of computer scientists, spelled in a mock-Greek alphabet.

Λ˘ινχ∂Nancy LynchKeeper of scroll entry 155; co-author of the FLP impossibility result the paper cites.
Φισ∂ερMichael FischerHolder of decree 132; the F in FLP.
ΤωυεγSam TouegStruck by a falling statue; developed irreversible amnesia.
ΓραϊJim GrayBallot number (13, Γραϊ); database transactions legend.
ΛινσεϊBruce LindsayBallot number (13, Λινσεϊ); System R database pioneer.
ΩκιBrian OkiMade president straight off the boat; co-invented Viewstamped Replication — the protocol equivalent to Paxos.
ΔφωρκCynthia DworkThe Monday-morning president who filled gaps with olive days.
Δ˘ικστραEdsger W. DijkstraFirst cheese inspector of Paxos — famously strict. Invented self-stabilization.
ΓωυδαMohamed GoudaSecond cheese inspector. Also a cheese.
ΦρανσεζNissim FrancezWine taster, two months.
Πνυελ˘ιAmir PnueliWine taster, one month; temporal-logic Turing laureate.
ΔωλεφDanny DolevThe farmer with the black (and brown) goats.
ΣκεενDale SkeenThe law-abiding merchant; three-phase-commit pioneer.
Στωκμ˘ιρLarry StockmeyerThe legislator with the out-of-date scroll.
Σ∂ν˘ιδερFred SchneiderCitizen reading the law via decree 87; wrote THE state-machine survey.
ΓρεεςDavid GriesThe second inquirer about the olive tax.
ΛισκωφBarbara LiskovMerchant comparing fleece tariffs; the Liskov of Viewstamped Replication.
ΠαρναςDavid ParnasElder statesman whose son inherited his scroll — information hiding at its finest.
ΣτρωνγRay StrongMade a legislator by decree 3252.
ΛαμπσωνButler LampsonThe general who staged the coup — and, in our world, the great champion of the Paxos algorithm.
Λεωνίδας ΓκίμπαςLeonidas GuibasProvided invaluable assistance with the Paxon dialect.
μαδζ∂ωριτ˘ισετ“majority set”The most contested word in Paxon philology.