Research Library · Idea
Distributed consensus
Distributed consensus is the problem of getting a group of processes, some of which may fail, to agree on a single value. Lamport states it in "Paxos Made Simple" as follows: given processes that can propose values, a consensus algorithm ensures that a single one among the proposed values is chosen, that no value is chosen if none is proposed, and that processes can learn the chosen value. The safety requirements are that only a proposed value may be chosen, only a single value is chosen, and a process never learns that a value has been chosen unless it actually has been.1 Lamport does not specify precise liveness requirements, but the goal is that some proposed value is eventually chosen and can eventually be learned.1
The difficulty depends on the failure and timing model. Fischer, Lynch and Paterson showed in 1985 that, in a completely asynchronous system with no clocks or time-outs, every consensus protocol has the possibility of nontermination even with one faulty process, although the message system is reliable and the failure is a simple stop.2 Dwork, Lynch and Stockmeyer introduced partial synchrony, between the synchronous and asynchronous cases, and gave consensus protocols for various cases of it.3 If faulty processes can behave arbitrarily, the problem is the Byzantine generals problem, which Lamport, Shostak and Pease show solvable with oral messages if and only if more than two-thirds of the generals are loyal.4
Paxos is the algorithm that Lamport's paper describes. It uses proposers, acceptors and learners, and treats a value as chosen when a majority of acceptors have accepted it. Any two majorities have an acceptor in common, which is why only a single value can be chosen. The model assumes agents that run at arbitrary speed, may fail by stopping and may restart, and messages that can be delayed, duplicated and lost but not corrupted. Lamport notes that two proposers can keep preempting each other so that no proposal is ever chosen, and that guaranteeing progress needs a distinguished proposer. He adds that, by the FLP result, a reliable algorithm for electing one must use either randomness or real time such as time-outs, while safety holds regardless of how the election goes.1
Ongaro and Ousterhout's Raft, described in a 2014 paper, is a consensus algorithm for managing a replicated log. They state that it produces a result equivalent to multi-Paxos and is as efficient as Paxos but is structured differently, separating leader election, log replication and safety. A Raft cluster is fully functional as long as any majority of servers are operational and can communicate, so a cluster of five servers tolerates the failure of any two, under the assumption that servers fail by stopping.5
Source · Paxos Made Simple (opens in a new tab) · Leslie Lamport
References
- Paxos Made Simple (opens in a new tab) · Leslie Lamport (author), dated 1 November 2001 · November 1, 2001 · Sections 1 and 2: the problem, choosing a value, progress. ↩ ↩ ↩
- Impossibility of Distributed Consensus with One Faulty Process (opens in a new tab) · Journal of the ACM (authors: Michael J. Fischer, Nancy A. Lynch and Michael S. Paterson) · JACM 32(2), April 1985. ↩
- Consensus in the Presence of Partial Synchrony (opens in a new tab) · Journal of the ACM (authors: Cynthia Dwork, Nancy Lynch and Larry Stockmeyer) · JACM 35(2), April 1988. ↩
- The Byzantine Generals Problem (opens in a new tab) · ACM Transactions on Programming Languages and Systems (authors: Leslie Lamport, Robert Shostak and Marshall Pease) · TOPLAS 4(3), July 1982. ↩
- In Search of an Understandable Consensus Algorithm (Extended Version) (opens in a new tab) · Stanford University (authors: Diego Ongaro and John Ousterhout) · May 20, 2014 · Published May 20, 2014 per the extended version; abstract and introduction. ↩
Research articles
- How machines and networks are put together: operating systems, the internet and distributed systems, and what their designers prioritized · Computer science
See what connects to it on the map of ideas →

SecSIG