CS 5204 – Operating Systems1 Paxos Student Presentation by Jeremy Trimble.

Slides:



Advertisements
Similar presentations
Consensus on Transaction Commit
Advertisements

Paxos and Zookeeper Roy Campbell.
Paxos Made Simple Leslie Lamport. Introduction ► Lock is the easiest way to manage concurrency  Mutex and semaphore.  Read and write locks in 2PL for.
CS 542: Topics in Distributed Systems Diganta Goswami.
CS425 /CSE424/ECE428 – Distributed Systems – Fall 2011 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S. Mitra, K. Nahrstedt, N. Vaidya.
NETWORK ALGORITHMS Presenter- Kurchi Subhra Hazra.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Paxos Steve Ko Computer Sciences and Engineering University at Buffalo.
1 Indranil Gupta (Indy) Lecture 8 Paxos February 12, 2015 CS 525 Advanced Distributed Systems Spring 2015 All Slides © IG 1.
Distributed Systems Overview Ali Ghodsi
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Byzantine Fault Tolerance Steve Ko Computer Sciences and Engineering University at Buffalo.
Consensus Hao Li.
The SMART Way to Migrate Replicated Stateful Services Jacob R. Lorch, Atul Adya, Bill Bolosky, Ronnie Chaiken, John Douceur, Jon Howell Microsoft Research.
Consensus Algorithms Willem Visser RW334. Why do we need consensus? Distributed Databases – Need to know others committed/aborted a transaction to avoid.
State Machine Replication Project Presentation Ido Zachevsky Marat Radan Supervisor: Ittay Eyal Winter Semester 2010.
Paxos Made Simple Gene Pang. Paxos L. Lamport, The Part-Time Parliament, September 1989 Aegean island of Paxos A part-time parliament – Goal: determine.
Eddie Bortnikov & Aran Bergman, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Recitation.
Distributed Systems CS Case Study: Replication in Google Chubby Recitation 5, Oct 06, 2011 Majd F. Sakr, Vinay Kolar, Mohammad Hammoud.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
CHUBBY and PAXOS Sergio Bernales 1Dennis Kafura – CS5204 – Operating Systems.
Chapter 6 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University Building Dependable Distributed Systems.
CS 425 / ECE 428 Distributed Systems Fall 2014 Indranil Gupta (Indy) Lecture 19: Paxos All slides © IG.
Eddie Bortnikov & Aran Bergman, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Recitation.
State Machines CS 614 Thursday, Feb 21, 2002 Bill McCloskey.
Byzantine Fault Tolerance CS 425: Distributed Systems Fall Material drived from slides by I. Gupta and N.Vaidya.
Distributed Storage System Survey
Paxos Made Simple Jinghe Zhang. Introduction Lock is the easiest way to manage concurrency Mutex and semaphore. Read and write locks. In distributed system:
Fault Tolerance via the State Machine Replication Approach Favian Contreras.
Coordination and Agreement, Multicast, and Message Ordering.
Bringing Paxos Consensus in Multi-agent Systems Andrei Mocanu Costin Bădică University of Craiova.
Practical Byzantine Fault Tolerance
Paxos A Consensus Algorithm for Fault Tolerant Replication.
Paxos: Agreement for Replicated State Machines Brad Karp UCL Computer Science CS GZ03 / M st, 23 rd October, 2008.
Byzantine Fault Tolerance CS 425: Distributed Systems Fall 2012 Lecture 26 November 29, 2012 Presented By: Imranul Hoque 1.
CSE 60641: Operating Systems Implementing Fault-Tolerant Services Using the State Machine Approach: a tutorial Fred B. Schneider, ACM Computing Surveys.
© Spinnaker Labs, Inc. Chubby. © Spinnaker Labs, Inc. What is it? A coarse-grained lock service –Other distributed systems can use this to synchronize.
Systems Research Barbara Liskov October Replication Goal: provide reliability and availability by storing information at several nodes.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Paxos Steve Ko Computer Sciences and Engineering University at Buffalo.
CS425 / CSE424 / ECE428 — Distributed Systems — Fall Nikita Borisov - UIUC1 Some material derived from slides by Leslie Lamport.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Paxos Steve Ko Computer Sciences and Engineering University at Buffalo.
The consensus problem in distributed systems
CS 525 Advanced Distributed Systems Spring 2013
Distributed Systems – Paxos
CSE 486/586 Distributed Systems Paxos
Distributed Systems CS
Distributed Systems: Paxos
Implementing Consistency -- Paxos
CS 525 Advanced Distributed Systems Spring 2018
Fault-tolerance techniques RSM, Paxos
CS 425 / ECE 428 Distributed Systems Fall 2017 Indranil Gupta (Indy)
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
Consensus, FLP, and Paxos
EEC 688/788 Secure and Dependable Computing
Fault-Tolerant State Machine Replication
EECS 498 Introduction to Distributed Systems Fall 2017
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
The SMART Way to Migrate Replicated Stateful Services
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
Implementing Consistency -- Paxos
CSE 486/586 Distributed Systems Paxos
Presentation transcript:

CS 5204 – Operating Systems1 Paxos Student Presentation by Jeremy Trimble

Paxos CS 5204 – Operating Systems2 Overview Distributed State Machine Distributed Consensus Fault-tolerance Requirements/Assumptions Paxos Algorithm Concepts The Algorithm Itself Examples Multi-Paxos Variations of Paxos

Paxos CS 5204 – Operating Systems3 Distributed State Machine Fault-tolerance through replication. Need to ensure that replicas remain consistent. Replicas must process requests in the same order.

Paxos CS 5204 – Operating Systems4 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? Simple solution: A single node acts as the “decider.”  But this is not fault tolerant. (What if the decider fails?) A better solution: Paxos

Paxos CS 5204 – Operating Systems5 Fault-Tolerant Consensus Requirements 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. Goals Liveness  FLP Impossibility Proof (1985)

Paxos CS 5204 – Operating Systems6 Assumptions Failures “Fail Stop” assumption  When a node fails, it ceases to function entirely.  May resume normal operation when restarted. Messages  May be lost.  May be duplicated.  May be delayed (and thus reordered).  May not be corrupt. Stable Storage

Paxos CS 5204 – Operating Systems7 Proposal An alternative proposed by a proposer. Consists of a unique number and a proposed value. ( 42, B ) We say a value is chosen when consensus is reached on that value. Paxos Terms Proposer Suggests values for consideration by Acceptors. Advocates for a client. Acceptor Considers the values proposed by proposers. Renders an accept/reject decision. Learner Learns the chosen value. In practice, each node will usually play all three roles. A1 P1

Paxos CS 5204 – Operating Systems8 Strong Majority “Strong Majority” / “Quorum” A set of acceptors consisting of more than half of all acceptors. Any two quorums have a nonempty intersection. Helps avoid “split-brain” problem. Acceptors decisions are not in agreement. Common node acts as “tie-breaker.” In a system with 2F+1 acceptors, F acceptors can fail and we'll be OK. Quorums in a system with seven acceptors. A1A6 A4 A5 A7 A3 A2

Paxos CS 5204 – Operating Systems9 Consensus time (N 5, V 3 ) (N 3, V 3 ) (N 2, V 2 ) (N 4, V 1 ) (N 1, V 1 ) (N 6, V 3 ) consensus reached, V 3 chosen (N 7, V 3 ) Values proposed by proposers are constrained so that once consensus has been reached, all future proposals will carry the chosen value. P2c. For any v and n, if a proposal with value v and number n is issued, then there is a set S consisting of a majority of acceptors such that either: (a) no acceptor in S has accepted any proposal numbered less than n, or (b) v is the value of the highest-numbered proposal among all proposals numbered less than n accepted by the acceptors in S. (N 2, V 2 ) A1 A2 A3 A4 A5

Paxos CS 5204 – Operating Systems10 Phase 1a:“Prepare” Select proposal number* N and send a prepare(N) request to a quorum of acceptors. Phase 1b:“Promise” If N > number of any previous promises or acceptances, * promise to never accept any future proposal less than N, - send a promise(N, U) response (where U is the highest-numbered proposal accepted so far (if any)) Phase 2a:“Accept!” If proposer received promise responses from a quorum, - send an accept(N, W) request to those acceptors (where W is the value of the highest-numbered proposal among the promise responses, or any value if no promise contained a proposal) Phase 2b:“Accepted” If N >= number of any previous promise, * accept the proposal - send an accepted notification to the learner Acceptor Proposer Basic Paxos Algorithm * = record to stable storage

Paxos CS 5204 – Operating Systems11 A1 P1 A2A3 time start promise(1) promise(1, -) prepare(1) accept(1, A) prepare(1) accepted(1, A)

Paxos CS 5204 – Operating Systems12 A1 P1 A2A3 time P2 prepare(1) accepted(1, A) prepare(1) prepare(2) promise(2, -) promise(2, (1,A)) prepare(1) accept(2, A) accepted(2, I) accepted(2, A) continued...

Paxos CS 5204 – Operating Systems13 A1 P1 A2A3 time promise(1) prepare(1) prepare(2) accepted(1, C) P2 prepare(1) accept(1, C) prepare(1) promise(2, -) prepare(1) accept(2, D) accepted(1, I) accepted(2, D) start

Paxos CS 5204 – Operating Systems14 A1 P1 A2A3 time promise(1) prepare(1) prepare(2) accepted(1, F) P2 prepare(1) accept(1, F) prepare(1) promise(2, -) prepare(1) prepare(3)... prepare(1) prepare(4) prepare(1) prepare(2)... start

Paxos CS 5204 – Operating Systems15 Other Considerations Liveness Can't be guaranteed in general. Distinguished Proposer  All proposals are funneled through one node. Can re-elect on failure. Learning the Chosen Value Acceptors notify some set of learners upon acceptance. Distinguished Learner A node may play the role of both distinguished proposer and distinguished learner – we call such a node the master.

Paxos CS 5204 – Operating Systems16 Multi-Paxos A single instance of Paxos yields a single chosen value. To form a sequence of chosen values, simply apply Paxos iteratively. To distinguish, include an instance number in messages. Facilitates replication of a state machine. “time” instance chosen valueSP???O

Paxos CS 5204 – Operating Systems17 Paxos Variations Cheap Paxos Reconfiguration  Eject failed acceptors.  Fault-tolerant with only F+1 nodes (vs 2F+1).  Failures must not happen too quickly. Fast Paxos Clients send accept messages to acceptors. Master is responsible for breaking ties. Reduces message traffic. Byzantine Paxos Arbitrary failures – lying, collusion, fabricated messages, selective non-participation. Adds an extra “verify” phase to the algorithm.

Paxos CS 5204 – Operating Systems18 Conclusion State-Machine Replication Distributed Consensus Basic Paxos Examples Optimizations Variations

Paxos CS 5204 – Operating Systems19 Questions?

Paxos CS 5204 – Operating Systems20 References Paxos Made Simple Paxos Made Live Wikipedia – Paxos Algorithm The Byzantine Generals Problem Impossibility of distributed consensus with one faulty process