Paxos questions if proposer down, what happened?
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Paxos is a consensus protocol developed by Leslie Lamport, which is designed to operate in distributed systems to achieve agreement on a single data value among a group of unreliable processors or servers. To understand the response to scenarios like a proposer failure, we need to be familiar with the roles and the process involved in Paxos:
Key Roles in Paxos:
- Proposers: Propose values to be accepted.
- Acceptors: Decide whether or not to accept the proposals.
- Learners: Learn the value that has been decided upon by the acceptors.
Paxos Protocol Overview:
Paxos protocol comprises of two main phases:
- Phase 1 (Prepare):
- A proposer selects a proposal number and sends a prepare request to a majority of acceptors.
- Each acceptor, on receiving this proposal, responds to the proposer with a promise not to accept any more proposals numbered less than , and the highest-numbered proposal (if any) that it has accepted so far.
- Phase 2 (Accept):
- If the proposer receives a response from a majority of acceptors, it sends an accept request with value , which is the value of the highest-numbered proposal received, or a new value if none was previously accepted.
- Acceptors then accept this proposal unless they have already responded to a higher-numbered prepare request.
What Happens if a Proposer Goes Down?
In the Paxos protocol, if a proposer fails or goes down during the consensus process, several implications and recovery strategies come into play:
- Downtime During Prepare Phase:
- If the proposer crashes before sending or completing the prepare requests, the acceptors will simply not receive a proposal or will not act further upon the partially received proposal.
- Another proposer can take over and start a new round of consensus with a higher proposal number.
- Downtime During Accept Phase:
- If the proposer fails after sending the prepare requests but before or during the sending of accept requests, acceptors may have promised not to accept earlier proposals but have not yet received the new accept request. Again, a new proposer can regenerate proposals starting with a new, higher proposal number.
- Handling Multiple Proposers:
- Paxos allows for multiple proposers, but to maintain consistency, it ensures that proposal numbers are unique and linearly increasing. Hence, when a new proposer takes up the task after a failure, it must choose a proposal number greater than all previously seen proposal numbers.
- Impact on System Performance:
- The downtime of a proposer can delay the consensus process, especially if the failure occurs before the accept phase where acceptors have already promised not to accept older proposals.
Recovery from Proposer Failure:
To facilitate recovery from a proposer failure, Paxos systems often implement mechanisms like:
- Heartbeat mechanisms to check for proposer availability.
- Automatic election of new proposers upon detection of an inactive proposer.
- Use of persistent storage to keep track of proposal numbers and accepted values to handle crashes.
Summary Table of Proposer Failure Scenarios:
| Phase of Failure | Immediate Effect | Recovery Strategy |
| Prepare | Proposals halted | Start new round with another proposer |
| Accept | Potential halt in acceptance | Use new proposer with higher proposal number |
| Multiple Proposers | Interruption if active proposer fails | Heartbeats and automatic election |
Paxos is designed fundamentally to handle failures and ensure that the consensus is eventually reached, albeit possibly with some delay depending on system recovery mechanisms. The protocol's robustness to failures, including proposer failures, highlights its effectiveness for distributed systems requiring high availability and reliability.
Related reading
- Paxos understanding
- paxos vs raft for leader election
- paxos why do ids have to increase monotonically?
- PBFT consensus algorithm and double spending
- Peak-finding algorithm for Python/SciPy
- Peak detection in a 2D array
- PBFT view-change What happens to committed operations after the valid snapshot?
- PBFT Why cant the replicas perform the request after 2/3 have prepared? why do we need commit phase?

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.