Multi-Paxos
Multi-Paxos extends basic Paxos to achieve consensus on sequences of values, enabling practical replicated state machines for distributed systems and databases.
Multi-Paxos runs Paxos for a sequence of log slots and lets a leader reuse a ballot for slots covered by a successful prepare phase. This guide explains ballot ordering, Phase 1 recovery, accepted versus chosen values, gaps, and safe snapshot-based truncation. A failure trace shows why a new leader must preserve an accepted value, and a comparison with Raft describes protocol differences without ranking either as universally faster or simpler.
Introduction
Basic Paxos chooses a value for one instance. Multi-Paxos runs instances for log slots so replicas can agree on an ordered sequence of commands. A value is chosen when acceptors in a quorum have accepted it. An individual acceptor’s record that it accepted a value is not enough by itself to show that the value was chosen.
Each slot has its own accepted value and ballot state. The safety rules stay the same across slots; the implementation has to recover those per-slot states when leadership changes and decide how to represent empty slots, snapshots, and membership changes.
These prepare and accept obligations follow Lamport’s Paxos Made Simple; the paper describes single-decree Paxos, while Multi-Paxos applies the rules across log slots.
Core Concepts
Ballots (also called proposal numbers or epochs) must be globally unique and totally ordered. A common representation combines a monotonically increasing counter with a proposer ID to break ties. An acceptor remembers its highest promised ballot and, for each slot, its highest accepted ballot and value. It rejects Prepare or Accept requests below its promise.
To establish ballot b, a proposer sends Prepare to acceptors and waits for promises from a quorum. Each promise reports the acceptor’s highest accepted ballot and value for the slots covered by the prepare. For every slot, the proposer must use the value associated with the highest accepted ballot reported by that quorum. It may choose a new client value only for a slot for which the quorum reports no prior accepted value. The exact slot range and promise format depend on the implementation.
Once Phase 1 has succeeded for a ballot and slot range, the leader can send Phase 2 Accept messages for slots in that range without repeating Phase 1 each time, as long as no higher ballot takes over. A Phase 2 quorum acceptance chooses the value. Pipelining or batching can change throughput, but neither changes this recovery rule.
sequenceDiagram
participant L as Leader
participant F1 as Follower 1
participant F2 as Follower 2
rect rgb(40, 40, 60)
Note over L,F2: Phase 1 establishes ballot 10 for covered slots
L->>F1: Prepare(n=10)
L->>F2: Prepare(n=10)
F1-->>L: Promise + accepted state for covered slots
F2-->>L: Promise + accepted state for covered slots
L->>F1: Accept(n=10, v="cmd1")
L->>F2: Accept(n=10, v="cmd1")
F1-->>L: Accepted
F2-->>L: Accepted
end
rect rgb(40, 60, 40)
Note over L,F2: Phase 2 for another covered slot, same ballot
L->>F1: Accept(n=10, v="cmd2")
L->>F2: Accept(n=10, v="cmd2")
F1-->>L: Accepted
F2-->>L: Accepted
L->>F1: Accept(n=10, v="cmd3")
L->>F2: Accept(n=10, v="cmd3")
F1-->>L: Accepted
F2-->>L: Accepted
end
Role of the Leader
Multi-Paxos implementations commonly let one proposer hold a ballot for a range of slots, which reduces competing proposals. Paxos itself does not require a separate election protocol: a proposer can try a higher ballot with Phase 1. If another proposer later obtains a higher ballot, acceptors reject the old leader’s lower-ballot requests.
Log Gaps and Truncation
Leadership recovery must inspect accepted state before proposing new values. For each covered slot, the new leader asks a quorum for its highest accepted ballot and value. If any response reports an accepted value, the leader proposes the value from the highest reported ballot. If none report a value, the slot may be assigned a new command or a no-op according to the log protocol.
graph LR
L1["Node 1<br/>Accepted: [A] [B] [C] [D] [E]"]
L2["Node 2<br/>Accepted: [A] [B] [C]"]
L3["Node 3<br/>Accepted: [A] [B] [C] [D]"]
L1 -->|Local state| C1["Acceptance on one node does not prove chosen"]
L2 -->|Quorum recovery| C2["New leader reads accepted state"]
L3 -->|Choose highest ballot| C3["Preserve the safe value per slot"]
An accepted value may or may not already be chosen. If it was chosen, every later Phase 1 quorum intersects the accepting quorum and reports an accepted value for that slot. The new leader preserves the highest-ballot value it learns. Local log copying may help replicas catch up, but it is not a substitute for Phase 1 recovery.
Skipped Log Indices
Accepted or chosen entries can exist after an empty slot, for example after leadership changes or concurrent proposals. A replicated state machine applies commands in slot order. The leader must recover every slot in the range it takes over, preserve any accepted value, and fill an empty slot with a client command or no-op before applying later slots. Snapshotting is a separate log-compaction mechanism, not a way to skip unresolved slots.
Recovery trace: a new leader finds an accepted value
Assume three acceptors, A, B, and C, so a quorum is two. Leader L1 proposes debit(10) for slot 7 at ballot 12. A and B accept it, but L1 fails before learning whether the value was chosen. It was accepted by a quorum, so it is chosen even if the client never received a response.
1. L1 -> A, B: Accept(ballot=12, slot=7, value=debit(10))
2. A, B: persist accepted state and reply Accepted
3. L1 fails before reporting the result
4. L2 -> B, C: Prepare(ballot=15, slots=...)
5. B reports slot 7 accepted at ballot 12; C reports no value
6. L2 -> B, C: Accept(ballot=15, slot=7, value=debit(10))
L2 must carry forward debit(10), not replace it with another client’s command. If only A had accepted the value and the Phase 1 quorum were B and C, the value might not have been chosen; quorum intersection and the highest-ballot rule still determine the safe proposal. A client that did not receive a result should retry with an idempotency key so the application can resolve an uncertain outcome.
Multi-Paxos vs Raft
Raft and Multi-Paxos both use quorum replication and a leader to order log entries. Raft specifies an integrated protocol, including leader election, log replication, and membership changes. Multi-Paxos is often described through Paxos ballots and per-slot acceptance; implementations choose how to package leader recovery, log repair, snapshots, and reconfiguration. These descriptions do not establish that one protocol is always easier or faster in a particular system.
graph LR
subgraph "Design Philosophy"
M[Multi-Paxos<br/>Paxos instances per slot<br/>Implementation choices] --> R[Raft<br/>Integrated replicated-log protocol<br/>Specified election and replication]
end
subgraph "Practical Trade-offs"
M2[Multi-Paxos<br/>Ballot reuse and quorum replication] --> R2[Raft<br/>Leader-based quorum replication]
end
| Aspect | Multi-Paxos | Raft |
|---|---|---|
| Safety basis | Paxos ballot promises and quorum intersection for each slot | Terms, leader election, and log-matching rules |
| Stable-leader replication | Reuse a ballot for slots covered by Phase 1; implementations may pipeline or batch | Replicate entries under the elected leader; implementations may pipeline or batch |
| Recovery | Phase 1 reports accepted state; the leader preserves the highest accepted ballot per slot | Election restrictions and log-matching rules prevent a leader from omitting committed entries |
| Snapshots and membership | Design and procedures depend on the Multi-Paxos implementation | Raft specifies snapshot installation and membership-change procedures |
The Raft paper is a primary reference for its integrated protocol. Lamport’s Paxos paper describes the prepare and accept rules that a Multi-Paxos leader reuses across slots. Compare implementations against their safety, recovery, reconfiguration, and operational requirements; complexity and performance depend on the implementation and workload.
Checkpointing and State Machine Recovery
Logs can grow beyond what is practical to retain or replay. A replica can snapshot its state after applying a chosen prefix, record the last included slot, and discard local log entries only when the snapshot and protocol metadata are durable. Snapshot creation, transfer, and truncation details depend on the implementation.
What a Checkpoint Contains
A checkpoint is not just a memory dump. It must capture everything needed to reconstruct the state machine at a specific log index:
class Checkpoint:
def __init__(self, last_included_slot, state, protocol_metadata):
self.last_included_slot = last_included_slot
# The snapshot reflects the applied state through this slot
self.state = state
# The actual state machine state (key-value pairs,
# document contents, etc.)
self.protocol_metadata = protocol_metadata
# Preserve configuration or other recovery state required by this implementation
The Replay Process
When a node restarts, it loads a durable snapshot and replays retained chosen entries after the snapshot’s last included slot. If it has fallen behind the retained log, it may need a snapshot transfer from a replica that has one.
graph TB
subgraph "State Machine Recovery"
S1[Read durable snapshot<br/>last_included=500<br/>state=Snapshot_500] --> S2[Find retained chosen slots<br/>501, 502, 503...]
S2 --> S3[Replay entry 501<br/>Apply to state]
S3 --> S4[Replay entry 502<br/>Apply to state]
S4 --> S5[Replay entry 503<br/>Apply to state]
S5 --> S6[State machine reflects<br/>the recovered chosen prefix]
end
Checkpoint Creation and Log Truncation
Each replica may snapshot its applied chosen prefix independently, provided the snapshot records the slot it includes and follows the implementation’s recovery rules.
sequenceDiagram
participant R as Replica
participant F as Lagging replica
participant SM as State Machine
R->>SM: Snapshot applied chosen prefix<br/>through slot k
R->>R: Persist snapshot and last included slot k
R->>R: Truncate covered local log prefix
F->>R: Request catch-up when retained log is insufficient
R-->>F: Transfer compatible snapshot and recovery metadata
F->>F: Restore snapshot, then recover later slots
Each replica may create and retain snapshots on its own schedule. A lagging replica can install a compatible snapshot and then learn or replay later chosen entries. The implementation must retain or transfer enough snapshot and log state for recovery; a local snapshot is not permission to discard another replica’s only recovery path.
Consistency Requirements
A snapshot must reflect an applied prefix of chosen slots; a node must not include a merely accepted, unchosen command in its state. Persist the snapshot atomically with its last included slot and any metadata the implementation needs to resume recovery. Truncate only the local log prefix represented by that durable snapshot, and retain a way to bring lagging replicas forward. Do not use a node’s highest local slot or a majority’s latest acknowledgement as a substitute for checking which values were chosen and applied.
Scalability Considerations
Performance depends on the leader’s work, quorum placement, durable-write path, batching, and replication workload. A stable ballot avoids repeating Phase 1 for covered slots, but it does not by itself predict throughput.
Leader Bottleneck
The leader coordinates each proposal and waits for responses from a quorum. Larger configurations can change the number and location of messages, but the cost depends on quorum selection, network topology, persistence, and batching. Benchmark the implementation you plan to run instead of estimating throughput from node count alone.
Message count and latency depend on quorum selection, network topology, durable writes, batching, and pipelining. Benchmark the implementation you plan to run instead of estimating throughput from node count alone.
Read Scalability Workarounds
Multi-Paxos clusters often implement follower reads for horizontal read scalability. Followers serve stale reads by applying committed log entries to their local state machine. This trades consistency for throughput.
Client --> Leader: write x=1
Leader --> Followers: Accept(n=10, v="write x=1")
Followers --> Leader: Accepted
Leader --> Client: committed
Client --> Follower: read x (returns local state, potentially stale)
For strong consistency reads, clients must route to the leader. Some systems use lease-based follower reads where the leader grants followers permission to serve reads for a time window, accepting staleness in exchange for distributed read throughput.
Membership Change Overhead
Basic Paxos does not define a general cluster-membership procedure. A Multi-Paxos implementation must specify how configurations are ordered, when a new configuration takes effect, and how old and new quorums relate during a transition. Follow the implementation’s documented procedure and test failure recovery during reconfiguration; do not assume that every deployment pauses traffic or uses Raft’s joint-consensus method.
Configuration changes are safety-critical because they change which acceptor sets count as quorums. Review the selected implementation’s reconfiguration protocol and recovery rules; a safe process cannot be inferred from the single-decree Paxos algorithm alone.
Durability and Performance Trade-offs
Paxos safety depends on acceptors retaining promises and accepted values across crashes. A value is chosen when a quorum accepts it. The implementation’s storage path defines when an acceptor may send its response and how it batches durable writes; that choice must preserve the protocol’s recovery assumptions.
The Durability Throughput Tension
An acceptor must make the relevant promise or accepted state durable before sending the response that relies on it, using the storage guarantees supported by its platform. A batch can reduce write overhead, but a node must not acknowledge state that its crash-recovery model cannot preserve. Measure the actual storage and protocol path before describing a durability or throughput trade-off.
Battery-Backed Write Caches
Enterprise storage systems use battery-backed write caches (BBWC) to accelerate durability acknowledgments. The cache is battery-protected, so data in the cache survives power loss. The storage system acknowledges writes after they hit the BBWC, before data reaches disk.
Leader --> Storage: write entry 501
Storage --> BBWC: append entry
BBWC --> Storage: acknowledged (durable even if power lost)
Storage --> Leader: Accepted
Leader --> Followers: Accept(n=10, v="entry 501")
Whether a device cache counts as durable depends on the storage system’s documented guarantees and failure modes. The acceptor must rely only on storage that meets the protocol’s persistence assumptions.
Batching proposals
Implementations may send several slot proposals together to reduce per-message overhead. Batching changes when the leader learns that values are chosen; it does not change the quorum rule or allow the leader to discard a value accepted by a quorum.
send_accept_batch(ballot, slot_values)
wait_until_each_value_is_accepted_by_a_quorum()
If the leader fails while a batch is in flight, each slot’s outcome is recovered through Phase 1. Entries accepted by a quorum are chosen; entries that were not chosen may still be present at some acceptors and must be handled by the recovery rule.
Relationship to Other Patterns
Multi-Paxos is a way to build a replicated ordered log. Two-Phase Commit solves a different problem: coordinating a transaction across participants.
For building complete replicated services, you’ll need more than just Multi-Paxos. My posts on Database Replication and Distributed Transactions explore how consensus fits into broader system designs.
Practical Applications
Chubby’s Paxos Made Live paper describes a production replicated state machine built with Paxos. Spanner uses Paxos groups for data replication; see the Spanner paper. Those systems include storage, recovery, and operational mechanisms beyond the consensus rules described here.
Production Failure Scenarios
Scenario 1: The Phantom Write Problem
What happened: A client sent a command to a leader, then lost its connection before learning the result.
Root cause: The leader failed after sending Accept to some acceptors. The client cannot tell whether enough acceptors accepted the value for it to be chosen. A new leader recovers the slot through Phase 1; if the value was chosen, quorum intersection makes it discoverable and the new leader preserves it.
Impact: The client has an uncertain outcome, even though the protocol can preserve safety.
Lesson learned: Retry with an idempotency key and let the application resolve whether the command already took effect. A client response must reflect the implementation’s chosen-value rule.
Scenario 2: The Stale Checkpoint Catastrophe
What happened: A node restarted from a snapshot that included a command the state machine had not safely applied.
Root cause: Snapshot creation did not bind the persisted state to the last included chosen slot, or the node applied an accepted but unchosen value.
Impact: The node’s recovered state no longer matched the state machine defined by the chosen log.
Lesson learned: Snapshot only an applied chosen prefix. Persist the snapshot together with its last included slot and required recovery metadata before truncating the corresponding local log entries.
Scenario 3: The Fsync Bottleneck Chain
Illustrative failure: A replicated key-value service experiences write latency spikes when its durable-write path falls behind proposal traffic.
Possible cause: The acceptors’ storage path cannot persist promises and accepted values at the rate the workload requires. Queueing delays rise and clients begin timing out.
Impact: The service became effectively unavailable during peak load despite having adequate CPU and network capacity.
Lesson learned: Profile the full write path in the target environment. Consider batching only when acceptor responses still honor the storage guarantees required by the protocol.
Common Pitfalls / Anti-Patterns
Multi-Paxos sounds simple, but production implementations face real challenges. The gap between theory and practice is substantial.
Client outcomes: A leader can fail after acceptors have responded but before the client receives an answer. The client may not know whether the value was chosen. Use an idempotency key to make retry behavior safe.
Snapshotting: A snapshot must correspond to an applied chosen prefix and include the last slot it covers. Keep a tested recovery path for lagging replicas before pruning local log entries.
Membership changes: Adding or removing nodes requires an implementation-specific reconfiguration protocol that preserves quorum safety.
Leader Stability Challenges
When a higher ballot takes over, its proposer must run Phase 1 for the slots it will handle. Frequent takeovers add recovery work and can reduce the benefit of reusing a ballot.
Consider a scenario with three nodes (N1, N2, N3) and a client issuing commands:
# At ballot 12, N1 proposes write(x=1) for slot 7; only A accepts it.
# N1 fails before the value reaches a quorum, so it is not yet chosen.
# N2 prepares ballot 15 with B and C; neither reports an accepted value.
# N2 may propose write(x=2) for slot 7 under ballot 15.
# After promising ballot 15, B and C reject later Accept messages at ballot 12.
If A and B had accepted write(x=1), that value would be chosen. N2’s Phase 1 quorum would intersect that accepting quorum and reveal a value to preserve. Client request IDs are an application concern; use them to deduplicate retries after an uncertain response, rather than treating them as Paxos slot numbers.
Log Compaction Interaction
Snapshots must identify the applied chosen prefix they represent. A follower behind that prefix can install a compatible snapshot and then recover later chosen slots.
graph TB
subgraph "Checkpoint Creation Process"
C1[Replica builds snapshot<br/>from applied chosen prefix]
C2[Persist snapshot and<br/>last included slot]
C3[Transfer snapshot to<br/>lagging replica if needed]
C4[Truncate only local log<br/>covered by durable snapshot]
C5[Recover later slots through<br/>protocol log state]
C1 --> C2 --> C3 --> C4 --> C5
end
Snapshot transfer and installation are implementation-specific. Preserve enough data and metadata to recover a follower whose local log no longer contains the full chosen prefix.
Disk I/O Bottlenecks
An acceptor must preserve accepted state according to the implementation’s crash model before sending an Accepted response.
# Typical accept handler with persistence
def on_accept(proposal_id, value):
# 1. Write to log (sequential I/O, relatively fast)
log.append(proposal_id, value)
# 2. Persist the promise and accepted value using the storage
# mechanism required by this implementation's crash model
log.persist(proposal_id, value)
# 3. Update in-memory state
state.update(value)
# 4. Send response
return Accepted(proposal_id)
The durable-write path can limit throughput, but the cost varies with storage, network, batching, and implementation. Batching is safe only when responses still match the persistence guarantees required for crash recovery; a crash does not permit an acceptor to forget a value it acknowledged.
Concurrency Control Limitations
Multi-Paxos decides on a sequence of values but provides no native concurrency control for overlapping writes to the same keys.
# Multi-Paxos does not handle this:
# Client A: write x = 1, read x
# Client B: write x = 2, read x
# If both operations touch the same key "x",
# Multi-Paxos guarantees they are ordered,
# but provides no mechanism to detect
# or prevent conflicting access patterns
# You must layer your own concurrency control:
# - External locking (Zookeeper advisory locks)
# - Optimistic concurrency (version vectors)
# - Pessimistic locking (2PL, MVCC)
For simple key-value stores, this is manageable. For complex transactions touching multiple keys, you need additional coordination.
Persistent State Requirements
Before sending Accept messages, a proper Multi-Paxos implementation must persist certain state to ensure crash safety.
# State that MUST be persisted before sending Accept
class AcceptorState:
def on_prepare_response(self, proposal_id, accepted_id, accepted_value):
# Persist promise before sending ack
# If we crash after sending Promise but before persisting,
# we might accept a lower-numbered proposal after restart
self.promised_id = proposal_id
persist_to_disk({
'promised_id': self.promised_id,
'accepted_id': self.accepted_id, # Also persist accepted
'accepted_value': self.accepted_value
})
def on_accept(self, proposal_id, value):
# Must persist BEFORE sending Accepted response
# If we crash after sending response but before persisting,
# we might lose knowledge of what we accepted
if proposal_id >= self.promised_id:
self.accepted_id = proposal_id
self.accepted_value = value
persist_to_disk({
'accepted_id': self.accepted_id,
'accepted_value': self.accepted_value
})
return Accepted(proposal_id)
The invariant is simple: once you have promised not to accept lower proposals, or have accepted a value, that state must survive crashes. Violating this leads to split-brain scenarios where different nodes believe different values were chosen.
Quick Recap
Before diving into implementation, ensure you understand:
- Basic Paxos agrees on a single value; Multi-Paxos extends this to a sequence of values
- A leader reuses a ballot only for slots covered by a successful Phase 1
- Phase 1 recovery preserves the highest accepted ballot’s value for each slot
- A value is chosen after quorum acceptance; acceptance at one acceptor alone is not enough
- Fill empty slots in order, and preserve accepted values before applying later commands
- A durable snapshot must reflect an applied chosen prefix before local log truncation
- Multi-Paxos provides no native concurrency control—layer it on top
- Snapshotting, membership changes, and performance depend on implementation details
Interview Questions
Key points:
- Basic Paxos only agrees on a single value; Multi-Paxos agrees on a sequence of values
- This enables replicated state machines where a distributed log drives state changes
- Each log position becomes a separate Paxos instance, but optimized for the common case
Key points:
- A successful Phase 1 establishes a ballot for the slots covered by that prepare
- The leader can send Phase 2 for those slots without repeating Phase 1, until a higher ballot takes over
- Persistence, network conditions, and implementation choices affect observed latency
Key points:
- A proposer uses a higher ballot and obtains promises from a quorum
- For each covered slot, it selects the value at the highest accepted ballot reported by the quorum
- It preserves reported accepted values; an empty slot may receive a new value or no-op
- Replicas may transfer log or snapshot data to catch up, but data transfer does not replace Phase 1 recovery
Key points:
- Phase 1 covers a ballot and slot range; the leader may reuse it for those slots
- A higher-ballot proposer must recover accepted values before proposing in the covered range
- Frequent takeovers add recovery work; observed impact depends on the implementation and workload
- Systems must balance leader leases, heartbeats, and failure detection carefully
Key points:
- Without snapshots, a node may need to retain and replay a longer log after restart
- Checkpointing periodically saves the state machine state and discards old log entries
- A checkpoint must capture everything needed to reconstruct state at a specific log index
- Snapshot only an applied prefix of chosen values and durably record its last included slot
- Truncate only the local prefix represented by that snapshot, while preserving a recovery path for lagging replicas
Key points:
- Acceptor promise and accepted state must survive crashes before the corresponding response is sent
- Implementations choose their durable-write mechanism and batching policy
- Benchmark disk, network, batching, and pipeline behavior in the target deployment
Key points:
- Membership changes require careful coordination to maintain consistency
- Basic Paxos does not define membership changes
- The implementation must specify configuration ordering and how quorums work during a transition
- Follow and test the selected implementation's reconfiguration protocol
Key points:
- Multi-Paxos decides the order of values but provides no conflict detection
- Overlapping writes to the same keys are ordered but not prevented
- Additional layering required: advisory locks (Zookeeper), optimistic concurrency (version vectors), or pessimistic locking (2PL, MVCC)
- For multi-key transactions, additional coordination beyond Multi-Paxos is essential
Key points:
- Multi-Paxos implementations must specify recovery, snapshots, and reconfiguration around the Paxos safety rules
- The Raft paper specifies an integrated leader-election and log-replication protocol
- Raft separates leader election from log replication explicitly; Multi-Paxos treats them as the same
- Neither protocol is universally simpler or faster; compare concrete implementations against requirements
Key points:
- Promise state: once promised not to accept lower-numbered proposals, that must survive crashes
- Accepted state: once accepted a value, that must persist before sending Accepted response
- The invariant: both promised_id and accepted_id/accepted_value must survive crashes
- Violating this leads to split-brain scenarios where nodes disagree on chosen values
Key points:
- Spanner uses Paxos groups for replication
- Chubby uses Multi-Paxos for its lock service coordination
- Production systems add recovery, storage, membership, and operational mechanisms around the consensus protocol
Key points:
- Multi-Paxos runs Paxos instances for multiple slots in a sequence
- Each log slot is treated as an independent Basic Paxos instance
- A proposer can reuse one successful ballot across covered slots
- A higher ballot triggers recovery of previously accepted values before new proposals
Key points:
- Slots may be empty even when later slots contain accepted or chosen values
- Recover the slots covered by Phase 1 and preserve the highest accepted value in each
- Fill empty slots before applying later commands to the state machine
- Snapshot truncation applies only to a durable snapshot of an applied chosen prefix
Key points:
- The follower must reconstruct state from its last checkpoint plus log entries after that index
- If it is behind the retained log, install a compatible snapshot or transfer the missing log data
- Persist promise and accepted state before sending the corresponding protocol response
Key points:
- A client may not know whether a request was chosen if the leader fails before replying
- A value accepted by a quorum is chosen even if the client did not receive the response
- Retry with an idempotency key so the application can resolve uncertain outcomes without duplicating effects
Key points:
- A successful Phase 1 permits Phase 2 for its covered slots without a new prepare each time
- Frequent higher-ballot takeovers require renewed recovery work
- Throughput also depends on persistence, network topology, batching, pipelining, and the implementation
Key points:
- Snapshot creation may run while the protocol continues, if the implementation keeps the snapshot tied to an applied chosen prefix
- Persist the snapshot and last included slot before truncating the covered local log
- Replica synchronization and snapshot transfer are implementation-specific
- Test restart and catch-up from a lagging replica using the actual snapshot procedure
Key points:
- Phase 1 covers a ballot and slot range; the leader can reuse it for those slots while no higher ballot takes over
- A new higher-ballot proposer must recover accepted values for the slots it will handle
- Implementations may use leases or other leadership mechanisms, each with its own failure and timing assumptions
- Measure the impact of leadership changes in the selected implementation
Key points:
- The client may not know whether a value was chosen before the leader failed
- The new leader uses Phase 1 recovery; it preserves a value if the quorum reports an accepted value
- Idempotency keys help clients safely retry without causing duplicate commands
- Use an idempotency key so an application retry can resolve an uncertain result without duplicating effects
Key points:
- Batching can send multiple slot proposals together and reduce per-message overhead
- Each slot still needs quorum acceptance to be chosen
- If the leader fails mid-batch, Phase 1 recovers each slot's accepted state
- Measure latency, throughput, and persistence behavior for the chosen implementation
Further Reading
- Paxos Made Simple — Leslie Lamport’s original paper
- Paxos Made Live — Google’s engineering retrospective on implementing Chubby’s Multi-Paxos variant
- The Chubby Lock Service — Original paper describing how Paxos underlies Google’s coordination service
- Spanner: Google’s Globally Distributed Database — Shows how Multi-Paxos variants synchronize replicas across data centers
- In Search of an Understandable Consensus Algorithm — The Raft protocol paper
- On the Parallels between Paxos and Raft — Formal analysis connecting the two consensus approaches
Conclusion
Multi-Paxos uses Paxos ballots to choose values for a sequence of slots. A leader can reuse a successful Phase 1 for covered slots, but safe recovery still depends on promises and accepted state being preserved. The Raft paper specifies a different integrated protocol; compare concrete implementations for recovery, reconfiguration, performance, and operational fit.
Category
Related Posts
Paxos Consensus Algorithm
Paxos is a family of consensus algorithms for achieving agreement in distributed systems despite failures, pioneered by Leslie Lamport.
Google Chubby: The Lock Service That Inspired ZooKeeper
Explore Google Chubby's architecture, lock-based coordination, Paxos integration, cell hierarchy, and its influence on distributed systems design.
Raft Consensus Algorithm
Raft is a consensus algorithm designed to be understandable, decomposing the problem into leader election, log replication, and safety.