paros ~
GitHub →
Consensus

The deployments

Four state machines a driver can run, one per process. Each has the same shape - step, then ready, then advance - and the configuration says which ones a journal uses.

The problem

The papers put each Paxos role on its own machine. A small system puts them all on one. A library must serve both: the same roles, wired in different ways, with no second copy of the protocol.

The technique

paros-consensus wires its roles into four deployments. Each deployment is one state machine that a driver runs as one process, and each has the same shape as the driver loop: step, then ready, then advance. Which deployments a journal runs is data in its Config (the matchmakers, the proxy leaders, the replicas, the quorum system), never a cargo feature. Plain Multi-Paxos is ColocatedNode alone.

Deployment Runs On disk For
ColocatedNode proposer, acceptor, replica promise, votes, chosen log every journal
ProxyLeader the leader’s Phase-2 tally nothing a busy leader
ReplicaNode a learner that serves reads chosen log more reads
Matchmaker the configuration registry ballot → configuration a change of acceptors

ColocatedNode

One node is proposer, acceptor and replica. The node that wins Phase 1 is the leader: it gives each write a slot and sends the Accepts. Every node votes, learns the chosen slots and applies the journal in slot order.

With no matchmakers in its Config, the node runs plain Multi-Paxos on a fixed membership: it steps no matchmaker message, writes no matchmaker state and refuses reconfigure. A leader can hand its ballot to a successor with no election (relinquish_to). Example: quickstart, journal_calls, leader_handoff. Flavor: Multi-Paxos.

ProxyLeader

A Multi-Paxos leader does two jobs for each write: it picks the slot, and it sends the Accepts, counts the Accepteds and sends the Commit. Only the first job must be on one machine. The leader gives the second job to a proxy leader. The proxy sends the same Accept to the column of the slot, counts the answers with the same tally the proposer uses, and sends the Commit to the learners.

A proxy votes on nothing and orders nothing, so moving it cannot break agreement. It keeps nothing durable: after a crash it boots empty, and the leader sends the rounds again. Its driver calls tick each beat. Example: proxy_leader. Flavor: Compartmentalized Paxos.

ReplicaNode

A replica learns the chosen log from the Commits and serves reads from it. It never votes: it answers no Prepare and no Accept, and it is in no quorum. A new acceptor makes each quorum larger; a new replica only adds read capacity.

A replica serves a read from its own chosen prefix (read_log), or runs a leaderless read against a row of acceptors (quorum_read_in). A replica that lags asks for the slots it lacks. Example: replica_tier, quorum_read. Flavor: Compartmentalized Paxos.

Matchmaker and MatchmakerReconfigurer

A matchmaker keeps a small durable map: each ballot and the configuration of acceptors that the ballot uses. A candidate registers its ballot at a majority of matchmakers before Phase 1, and learns each configuration used below it. Then a change of acceptors is only a new ballot with a new configuration. The matchmakers see a message only on a round change, never on a write.

The node sends Ready::match_requests and Ready::gc_requests after the batch is durable, and gives the answers back with on_match_reply and on_gc_ack. The matchmaker set itself moves to a new generation with MatchmakerReconfigurer: it stops the old set, starts the new one, and chooses it with a single decree (Decree) over the old set. Matchmaker quorums are majorities. Example: reconfiguration, matchmaker. Flavor: Matchmaker Paxos.

In paros