Contradiction in Lamport's Paxos made simple paper
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Leslie Lamport's "Paxos Made Simple" paper is a seminal work in the field of distributed computing, detailing a protocol for achieving consensus among a group of computers (or nodes). Despite its aim to simplify the understanding of the Paxos algorithm, some readers find parts of the paper seemingly contradictory or challenging to interpret. This article aims to dissect these complexities, providing technical explanations where necessary, and enhancing understanding through examples and a summarized table.
Understanding Paxos
At its core, the Paxos protocol is designed to allow a group of participants to agree on a single value (e.g., a data entry or a system state) in a network of unreliable processors. The protocol is crucial because it ensures consistency despite individual elements of the system failing or acting unpredictably.
The Basics of Paxos
Paxos divides the decision-making process into a series of rounds, and each round has three phases:
- Prepare: A proposer selects a proposal number and sends a prepare request with this number to the acceptors.
- Promise: Acceptors respond to the prepare requests. An acceptor promises not to accept any proposals numbered less than the proposal number received and sends back the highest-numbered proposal (if any) that it has already accepted.
- Accept: If the proposer receives a response from the majority of acceptors, it sends an accept request to each of those acceptors for a proposal consisting of its proposal number and the highest-numbered value received (or its own value if none were received).
Through these three phases, the protocol aims to ensure that a majority of acceptors agree on a single proposed value before it is chosen, thereby achieving consensus.
Contradictions and Clarifications
The Role of Leader vs. Multiple Proposers: One perceived contradiction arises from Lamport’s simplification in discussing the role of a "distinguished proposer" or leader in Paxos. Initially, it seems as if the leader uniquely drives the protocol. However, the detailed explanation allows multiple proposers to simultaneously initiate proposals. It's not a direct contradiction but rather a simplification for explanation purposes.
Stability of Chosen Values: Another confusion lies in the interpretation that once a value has been chosen in Paxos, it cannot change. Here, "chosen" does not imply that all nodes immediately know about the choice. Instead, it suggests a guarantee provided by the protocol structure: once a value is chosen, any successful proposal must be consistent with that value, even if some nodes aren't yet aware that the value is chosen.
Liveness vs. Safety: Lamport's paper concentrates on the "safety" properties of Paxos, ensuring that no two nodes make inconsistent decisions about the chosen value. The issue of "liveness" – whether the system reaches a decision at all – is somewhat secondary in the paper. This can be misleading because achieving liveness (making progress) is critical in practical applications and requires additional mechanisms, such as selecting a stable leader.
Examples and Summarization
For a practical illustration, imagine a distributed database handling transactions across different geographical locations. If a coordinator (proposer) in New York sends out a proposal for a transaction update and a majority of database servers (acceptors) worldwide agree on this proposal, Paxos ensures that even if some servers didn't participate due to, say, a network outage, the transaction is consistently recorded across the system.
| Phase | Description | Importance |
| Prepare | Proposer sends a proposal number to acceptors | Establishes initiative and checks acceptor state |
| Promise | Acceptors promise based on received proposal | Prevents older proposals from interfering |
| Accept | Proposer sends final proposal for acceptance | Ensures that a majority agrees on the value |
Conclusion
While Lamport's "Paxos Made Simple" aims to demystify the consensus protocol, its concise treatment can sometimes gloss over complexities that lead to perceived contradictions. By examining the nuances of these phases and correcting misunderstandings around concepts like leadership and value stability, one can better appreciate the elegance and resilience of Paxos in distributed systems.

