You are on page 1of 20

Paxos

Student Presentation
Ahmad Alsharef

1
Distributed State Machine

 Fault-tolerance through replication.
 Need to ensure that replicas remain consistent.
 Replicas must process requests in the same order.

2
The Distributed Consensus Problem
 In a distributed system, how can we:
 Select a single action among many options?
 How can this be done in a fault-tolerant way?

C1 :+10%
210$
S1
100$
S2
220$
C2 :+100$

 Simple solution:
 A single node acts as the “decider.”
 But this is not fault tolerant. (What if the decider fails?)
 A better solution: Paxos

3
Overview
 What is Paxos ?
 History
 Lamport
 Fred B. Schneidere
 Paxos Island in Greece

 Assumptions
 processors
 Network
 messages
 Number of processors

4
Paxos Terms & Rules
P1
 Client  Proposer (s)
 Suggests values for consideration
The Client issues a request to by Acceptors.
the distributed system, and waits  Advocates for a client.
for a response.
 Acceptor (s) (voters) A1

 Learner  Considers the values proposed by
proposers.
 Learns the chosen value.  Renders can accept/reject
decision.
 In practice, each node will
usually play all three roles.

5
Paxos Terms & Rules
 Quorums  Proposal
Quorums are defined as subsets of the  An alternative proposed by a
Acceptors set .
proposer.
Typically, a Quorum is any majority of
participating Acceptors. For example,  Consists of a unique number
given the set of Acceptors {A,B,C,D}, and a proposed value.
a majority Quorum would be any three
Acceptors: {A,B,C}, {A,C,D}, {A,B,D}, ( 42, B )
{B,C,D}.
Proposal Number & Agreed Value

Each attempt to define an agreed value
v is performed with proposals which
may or may not be accepted by
Acceptors. Each proposal is uniquely
numbered for a given Proposer. .

6
Fault-Tolerant Consensus
 Requirements
 Non-triviality
 Safety
 Only a value that has been proposed may be chosen.
 Only a single value is chosen.
 A process never learns that a value has been chosen
until it actually has been.
 Liveness
 FLP Impossibility Proof (1985)

7
Message flow: Basic Paxos

P1 A1 A2 A3 L L

start
prepare(1)

promise(1)

accept(1, A)

accepted(1, A)

time
9
Message flow: Basic Paxos, failure of Acceptor
Message flow: Basic Paxos, failure of redundant Learner
Message flow: Basic Paxos, failure of Proposer

CS 5204 – Operating Systems
Message flow: Basic Paxos, dueling Proposers
Message flow: Basic Paxos, dueling Proposers
Paxos Variations
 Fast Paxos
 If Propser has no value to propose , Clients send acceptRequesr messages
directly to acceptors.
 Acceptors send accepted message to leader .
 Reduces message traffic.

15
Multi-Paxos
uses a distinguished leader to coordinate an infinite stream of commands.
No need to proposal in second time
To achieve this, the instance number I is included along with each value.

CS 5204 – Operating Systems
Multi-Paxos reduces the failure-free message delay
(proposal to learning)
from 4 delays to 2 delays.

CS 5204 – Operating Systems
Paxos Variations
 Cheap Paxos
 Eject failed acceptors.
 F failures with F+1 main processors and F auxiliary.
 Failures must not happen too quickly.
 Otherwise , the system must halt until the auxiliary
processors can reconfigure the system

 Byzantine Paxos
 Arbitrary failures – lying, collusion, fabricated messages,
selective non-participation.
 Adds an extra “verify” phase to the algorithm.

18
Questions?

19
References
 Paxos Made Simple
 http://courses.cs.vt.edu/cs5204/fall10-kafura-NVC/Papers/FaultTolerance/Paxos-Simple-Lamport.pdf
 Paxos Made Live
 http://courses.cs.vt.edu/cs5204/fall10-kafura-NVC/Papers/FaultTolerance/Paxos-Chubby.pdf
 Wikipedia – Paxos Algorithm
 http://en.wikipedia.org/wiki/Paxos_algorithm
 The Byzantine Generals Problem
 http://research.microsoft.com/en-us/um/people/lamport/pubs/byz.pdf
 Impossibility of distributed consensus with one faulty process
 http://portal.acm.org/citation.cfm?doid=3149.214121

20