paros ~
GitHub →
Paxos

Concepts

Each idea that paros uses, in a few sentences. Each entry comes from a card of the knowledge base, and links to the page that shows it and to the full card with its sources.

The words of the Paxos flavors page are used here with the same meaning.

Kernel

Single-decree Paxos

Single-decree Paxos chooses one value among the values that proposers propose, with no bound on message delay and with crashes. Every other card builds on it. paros runs it in two forms: inside the Multi-Paxos log (one instance per slot), and alone as Decree<Id, V> for a one-shot decision (the matchmaker handover and cell init).

Code (in paros-consensus/src/ unless it names a crate): decree.rs, acceptor.rs

Multi-Paxos log and stable leader

Multi-Paxos runs one single-decree instance per slot of a log. A stable leader runs one Phase 1 for every slot from its first unchosen slot on, then pays only Phase 2 per new command. A replica applies the chosen commands in slot order. In paros the log is a journal: each slot carries a Command (a Write, a Truncate, a SetLeader, a Noop), and the "state machine" is the journal-control fold (journal/state.rs).

Code (in paros-consensus/src/ unless it names a crate): proposer.rs, replica.rs, node/phase2.rs, node/learn.rs

Persist before send

An acceptor's answer is a promise about its future: "I will refuse every ballot below b" or "I accepted v at b". The promise holds across a crash only if the state behind it is on stable storage before the answer leaves. paros makes this order structural: the core hands the driver one batch, Ready, whose writes the driver persists before it sends the batch's messages. One exception exists, and it is safe: a leader's own Accepts may leave before its own vote is durable (#578 (leader sends Accept before its own fsync)).

Code (in paros-consensus/src/ unless it names a crate): node/ready.rs, contract/hard_state.rs, contract/write.rs, paros-roles node/ready.rs; the journal's flight rule: specs/tla/flight-rule/

Pipelining and resend

A stable leader does not wait for slot i to be chosen before it proposes slot i+1: it keeps several Phase-2 rounds open at once (pipelining). A lost Accept leaves a round open with no quorum, so the leader re-sends the open rounds on each beat. In paros the re-send is a method the driver calls, ColocatedNode::resend_pending, and skipping a call is always safe.

Code (in paros-consensus/src/ unless it names a crate): node/policy.rs, proposer/rounds.rs

Catch-up

A node that missed a Commit (and often its Accept) has a hole in its chosen prefix. The leader re-sends only rounds that are still open, so nothing would ever fill that hole. Catch-up fills it: a node that learns it is behind asks a peer to replay the decided slots, and a node behind a peer's compaction floor jumps to that floor (Message::TrimmedTo). In paros catch-up is a pull, triggered by the leader's beat, with a push in the other direction for a leader that lost its chosen index.

Code (in paros-consensus/src/ unless it names a crate): node/catch_up.rs, node/replication.rs

Leader

Election, P2c merge and gap fill

A node becomes the leader of a cell by winning Phase 1 at a fresh ballot. The win gives it two duties before it may propose new commands: re-propose every value that a quorum reports (the P2c merge), and fill every slot that nobody reports with a Noop (the gap fill). paros also records every round the leader opens in the leader's own log (record_own_round), so the allocator frontier survives a restart.

Code (in paros-consensus/src/ unless it names a crate): proposer/election.rs, proposer/recovery.rs, node/election.rs, node/phase2.rs

Paging a campaign

A Paxos Promise carries the acceptor's whole accepted suffix from the asked slot, and that suffix has no bound. paros sends it in pages: at most Limits::promise_page entries per Promise, with a cursor (next_from_slot) for the next page. The candidate asks page after page and counts an acceptor in its Phase-1 quorum only after its last page. While it pages, it keeps the peers that already answered quiet with a cheap keep-alive Prepare (Election::keep_alive_from) that they answer with an empty page.

Code (in paros-consensus/src/ unless it names a crate): contract/limits.rs, acceptor.rs (promise_page), proposer/election.rs, node/election.rs

Leadership fence and CheckQuorum

A paros leader holds a standing authority beside its Phase-2 rounds: a fence (the highest slot a predecessor could have acked) and a CheckQuorum window (the acceptors that acked at the leader's ballot in the current election timeout). A leader that cannot fill the window with a Phase-2 quorum of its configuration steps down.

Code (in paros-consensus/src/ unless it names a crate): proposer/authority.rs, node/authority.rs

Leader handoff

A live leader can give its Phase-2 authority (its ballot, its allocator frontier and its unfinished rounds) to one named member with one Relinquish message. The successor continues Phase 2 under the same ballot, with no Phase 1. The old leader abdicates in the same call that queues the message. paros calls this the cooperative handoff (relinquish_to); the source is DPaxos's Leader Handoff (DPaxos §4.4).

Code (in paros-consensus/src/ unless it names a crate): node/handoff.rs

Quorums

Grid quorums (acceptor partitions)

Lay the acceptors out in a grid. A column decides a slot; a Phase 1 needs enough acceptors of every column. Each slot's Phase 2 goes to one column only, so each acceptor sees 1 / cols of the commands and the acceptor tier's throughput grows with cols (SRSM §3.2). paros generalizes the full-column grid to acceptor partitions (#532 (acceptor partitions)): a column is a partition of 2F+1 acceptors, a majority of one partition decides, and a majority of every partition elects.

Code (in paros-consensus/src/ unless it names a crate): membership/quorum_system.rs, node/policy.rs (move_round), paros-roles node/grid.rs

Zone rule

A cell spans several availability zones. A journal survives the loss of a zone only if its acceptors are spread so that the members outside any one zone still hold both quorums. The zone rule is two predicates over a configuration's members and their failure domains, each asked through the configuration's own quorum predicates, never a count (#215 (zones)):

1. It survives any one failure domain: for every domain, the members outside it still hold a Phase-1 quorum and a Phase-2 quorum. 2. No domain commits alone: for every domain, the members inside it hold no Phase-2 quorum.

Code (in paros-consensus/src/ unless it names a crate): membership/zone_rule.rs, membership/failure_domain.rs, paros-model placement.rs

Compartmentalization

Proxy leaders

A Multi-Paxos leader has two jobs: it sequences commands into slots, and it broadcasts each slot's Accept, folds the Accepteds and emits the Commit. Only the first job must be serial. A proxy leader takes the second job: the leader sends one delegated Accept per command to a proxy, and the proxy runs the Phase-2 fan-out and fold (SRSM §3.1). A proxy contributes nothing to the decision, so moving it cannot break agreement. In paros the proxy is ProxyLeader (#142): a Rounds plus routing, and no state that survives a crash.

Code (in paros-consensus/src/ unless it names a crate): proxy_leader.rs, proposer/rounds.rs, node/policy.rs, models/proxy.rs, paros-roles proxy_leader.rs

Batchers and unbatchers

With batching, a leader puts many commands in one slot. But the leader still receives one message per command, so its cost stays linear in commands. A batcher takes the job of forming batches off the leader: clients send to a batcher, and the batcher sends the leader one message per batch. An unbatcher takes the job of answering each command off the replica (SRSM §4.1–§4.2). In paros a batcher merges many writers' writes of one multi-writer journal into one slot, and the unbatcher hands each write its own seq range back (#145 (batchers)).

Code (in paros-consensus/src/ unless it names a crate): batcher.rs, paros-roles batcher.rs

Replica tier

A replica learns the chosen log and never votes. Because it is in no configuration, adding a replica adds read capacity and never a vote, so the replica tier scales apart from the acceptors (SRSM §3.3). In paros a replica is a ReplicaNode (#144): a Replica over a durable chosen log, with no Acceptor at all. Since paros runs no application (#186), a replica is a read replica: it serves journal reads from its own chosen prefix, so read load leaves the acceptors.

Code (in paros-consensus/src/ unless it names a crate): replica_node.rs, replica.rs, paros-roles replica.rs

Reads

Leaderless quorum reads

A linearizable read that never touches the leader and never reads a clock. The reader asks a Phase-1 quorum of acceptors for their vote watermarks (the highest slot each voted in), takes the maximum, and serves the read once its own applied prefix covers that index (SRSM §3.4, after Paxos Quorum Reads PQR §4). Every write acknowledged before the read began is then visible to it. In paros every Read takes this path (QuorumRead, #143), on any node or replica: there is no lease read and no read through the leader.

Code (in paros-consensus/src/ unless it names a crate): quorum_read.rs, node/quorum_reads.rs, acceptor.rs (vote_watermark), replica_node.rs

Reconfiguration

Matchmaking and Phase 1 over every configuration

When every round may use a different acceptor configuration, a candidate must know which configurations earlier rounds used, so its Phase 1 can block them all. Matchmakers are a registry of ballot → configuration. Before any Prepare, a candidate registers (b, C_b) at a matchmaker quorum and gets back every configuration registered below b; their union above the maximum GC watermark is H_b. Phase 1 then needs a promise quorum of every configuration in H_b, and Phase 2 addresses C_b alone (MMP §3.1–§3.2).

Code (in paros-consensus/src/ unless it names a crate): matchmaking.rs, node/matchmaking.rs, matchmaker.rs

Reconfiguration as a round change, beliefs and the membership probe

A configuration is bound to a ballot and never edited. To change the acceptor set, the leader opens a fresh ballot with the new configuration: it matchmakes (b', C_new), runs Phase 1 over every configuration in H_b', and leads at b' under C_new (MMP §4.3). The configuration in force is a fact the matchmakers hold: the highest-ballot reconfiguration registration a matchmaker quorum holds. What a node believes is only a belief. A node that does not know the fact asks for it with a membership probe, which registers nothing.

Code (in paros-consensus/src/ unless it names a crate): node/reconfigure.rs, matchmaking/probe.rs, paros-coordinator tenant/moves.rs

Configuration GC and retirement

Every configuration a matchmaker returns costs the next candidate a Phase-1 quorum of it, and its acceptors cannot be shut down while a candidate may still ask them. Garbage collection (GC) raises the matchmakers' watermark so they never return the configurations below it again (MMP §3.4). A configuration may be forgotten only when no future leader can need its Phase-1 quorum to learn a value it may have chosen (MMP §3.5). In paros a leader's floor is effective only once a matchmaker quorum acked it durably; only then are the old members retirable, and a node honors Retire only with that floor as evidence.

Code (in paros-consensus/src/ unless it names a crate): collector.rs, node/gc.rs, paros-roles node/operator.rs

Matchmaker generations and handover

Matchmakers also fail and move, so the matchmaker set must change too. Matchmakers are idle while a leader is stable, so their reconfiguration must be safe but need not be fast (MMP §5). paros numbers each set as a generation g. A handover stops a quorum of M_g, bootstraps the successor with the union of their registries above the maximum watermark, has M_g choose the successor by single-decree Paxos, and publishes the chosen set. A stopped matchmaker points late callers at its successor.

Code (in paros-consensus/src/ unless it names a crate): matchmaker/generation.rs, matchmaker/reconfigurer.rs, decree.rs, models/handover.rs

Storage

Corrupted storage recovery

Paxos assumes stable storage. A real disk breaks that: a block returns an error, or silently returns other bytes (PAR §2.1). Protocol-aware recovery (CTRL) uses the copies other nodes hold. The store detects a damaged record and reports its identity; the protocol then decides, per slot, whether the value may have been chosen. In paros a damaged accepted record is faulty: its slot and ballot are known, its value is lost. A Promise reports it as a third answer beside have and none, and faulty is silence, never denial: it never counts as "nothing accepted here".

Code (in paros-consensus/src/ unless it names a crate): acceptor.rs, proposer.rs, proposer/probe.rs, paros-storage journal.rs

Truncation, compaction floor and trim-point jump

A log that only grows needs unbounded disk and unbounded recovery time (PML §5.5). paros keeps it finite in three steps. Truncation is a Paxos-decided control command, Truncate, judged at apply and, on a single-writer journal, fenced by the leader uuid like a Write: it raises the journal's first_seq. Each node then compacts lazily when its apply walk reaches that slot, and raises its compaction floor. A node whose catch-up asks below a peer's floor gets a trim-point jump (Message::TrimmedTo): the floor and the journal state, no bytes and no ballot.

Code (in paros-consensus/src/ unless it names a crate): journal/state.rs, acceptor/retention.rs, node/learn.rs, node/catch_up.rs

Boot safety: the format marker, and a wiped node never rejoins

The code this card maps (the format marker, the boot claim and the amnesia refusal) was in paros-storage, paros-roles and paros-machine, which were removed on 2026-11-19. It is at the git tag v0.2.0-alpha.1 (recaps in docs/archive/v0.2.0-alpha.1/). The rule stays: the journal v1 must build it again on its own storage. §9 says what the tree holds today.

An acceptor's promise is a statement about its own future that no other node holds. A node that lost its disk and boots empty would answer a Phase 1 with "nothing accepted" for slots it once voted on: it reneges on its promises (PML §5.1). An empty disk looks exactly like a first boot, so paros does not guess. The operator states what it boots (BootKind), the store carries a durable format marker, and the library refuses a boot where the two disagree. A wiped node never rejoins: the acceptor set heals around it by reconfiguration, and a wiped matchmaker is replaced by a handover.

Code (in paros-consensus/src/ unless it names a crate): paros-storage boot.rs, paros-roles node/boot.rs, matchmaker.rs

On the log

Writer fence: the leader uuid, judged at apply

Paxos decides what is in the log. It does not decide who may write: a client that lost its leadership can still send a write, and Paxos will happily choose it. A single-writer journal fences its writers with a leader uuid. SetLeader(new, old) is a compare-and-set recorded in the log, and every Write and Truncate carries the uuid. A small state machine judges each call at apply, in slot order, on every node alike: a call under a superseded uuid is refused in place. The Paxos ballot fences machines; the leader uuid fences clients. The two never mix.

Code (in paros-consensus/src/ unless it names a crate): journal/state.rs, replica.rs, paros-client writer.rs, pipeline.rs