Lecture 8-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2010 Indranil Gupta (Indy) September 16, 2010 Lecture 8 The Consensus.

Slides:



Advertisements
Similar presentations
Distributed Computing 8. Impossibility of consensus Shmuel Zaks ©
Advertisements

Impossibility of Distributed Consensus with One Faulty Process
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Consensus 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
Distributed Computing 8. Impossibility of consensus Shmuel Zaks ©
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Consensus Steve Ko Computer Sciences and Engineering University at Buffalo.
Sliding window protocol The sender continues the send action without receiving the acknowledgements of at most w messages (w > 0), w is called the window.
Announcements. Midterm Open book, open note, closed neighbor No other external sources No portable electronic devices other than medically necessary medical.
Distributed Algorithms – 2g1513 Lecture 10 – by Ali Ghodsi Fault-Tolerance in Asynchronous Networks.
CS 425 / ECE 428 Distributed Systems Fall 2014 Indranil Gupta (Indy) Lecture 13: Impossibility of Consensus All slides © IG.
Computer Science 425 Distributed Systems CS 425 / ECE 428 Consensus
Consensus Hao Li.
Distributed Computing 8. Impossibility of consensus Shmuel Zaks ©
Byzantine Generals Problem: Solution using signed messages.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 3 – Distributed Systems.
Asynchronous Consensus (Some Slides borrowed from ppt on Web.(by Ken Birman) )
CPSC 668Set 9: Fault Tolerant Consensus1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
CPSC 668Set 9: Fault Tolerant Consensus1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
1 Fault-Tolerant Consensus. 2 Failures in Distributed Systems Link failure: A link fails and remains inactive; the network may get partitioned Crash:
Impossibility of Distributed Consensus with One Faulty Process Michael J. Fischer Nancy A. Lynch Michael S. Paterson Presented by: Oren D. Rubin.
 Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 6: Impossibility.
 Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 12: Impossibility.
Cloud Computing Concepts
Distributed Algorithms: Agreement Protocols. Problems of Agreement l A set of processes need to agree on a value (decision), after one or more processes.
CS 425 / ECE 428 Distributed Systems Fall 2014 Indranil Gupta (Indy) Lecture 19: Paxos All slides © IG.
On the Cost of Fault-Tolerant Consensus When There are no Faults Idit Keidar & Sergio Rajsbaum Appears in SIGACT News; MIT Tech. Report.
Consensus and Related Problems Béat Hirsbrunner References G. Coulouris, J. Dollimore and T. Kindberg "Distributed Systems: Concepts and Design", Ed. 4,
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Consensus Steve Ko Computer Sciences and Engineering University at Buffalo.
Paxos Made Simple Jinghe Zhang. Introduction Lock is the easiest way to manage concurrency Mutex and semaphore. Read and write locks. In distributed system:
Distributed Consensus Reaching agreement is a fundamental problem in distributed computing. Some examples are Leader election / Mutual Exclusion Commit.
Distributed Consensus Reaching agreement is a fundamental problem in distributed computing. Some examples are Leader election / Mutual Exclusion Commit.
Distributed Algorithms – 2g1513 Lecture 9 – by Ali Ghodsi Fault-Tolerance in Distributed Systems.
For Distributed Algorithms 2014 Presentation by Ziv Ronen Based on “Impossibility of Distributed Consensus with One Faulty Process” By: Michael J. Fischer,
Consensus and Its Impossibility in Asynchronous Systems.
Computer Science 425 Distributed Systems (Fall 2009) Lecture 10 The Consensus Problem Part of Section 12.5 and Paper: “Impossibility of Distributed Consensus.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 8 Instructor: Haifeng YU.
DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch Set 11: Asynchronous Consensus 1.
CS294, Yelick Consensus revisited, p1 CS Consensus Revisited
CS 425/ECE 428/CSE424 Distributed Systems (Fall 2009) Lecture 9 Consensus I Section Klara Nahrstedt.
Distributed systems Consensus Prof R. Guerraoui Distributed Programming Laboratory.
Sliding window protocol The sender continues the send action without receiving the acknowledgements of at most w messages (w > 0), w is called the window.
Hwajung Lee. Reaching agreement is a fundamental problem in distributed computing. Some examples are Leader election / Mutual Exclusion Commit or Abort.
Chap 15. Agreement. Problem Processes need to agree on a single bit No link failures A process can fail by crashing (no malicious behavior) Messages take.
Impossibility of Distributed Consensus with One Faulty Process By, Michael J.Fischer Nancy A. Lynch Michael S.Paterson.
1 CS 525 Advanced Distributed Systems Spring Indranil Gupta (Indy) Lecture 6 Distributed Systems Fundamentals February 4, 2010 All Slides © IG.
Chapter 21 Asynchronous Network Computing with Process Failures By Sindhu Karthikeyan.
Alternating Bit Protocol S R ABP is a link layer protocol. Works on FIFO channels only. Guarantees reliable message delivery with a 1-bit sequence number.
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
DISTRIBUTED ALGORITHMS Spring 2014 Prof. Jennifer Welch Set 9: Fault Tolerant Consensus 1.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 9 Instructor: Haifeng YU.
CSE 486/586 CSE 486/586 Distributed Systems Consensus Steve Ko Computer Sciences and Engineering University at Buffalo.
The consensus problem in distributed systems
When Is Agreement Possible
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Lecture 16-A: Impossibility of Consensus
Cloud Computing Concepts
Alternating Bit Protocol
Distributed Consensus
Distributed Consensus
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
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
FLP Impossibility of Consensus
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
CSE 486/586 Distributed Systems Consensus
Presentation transcript:

Lecture 8-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2010 Indranil Gupta (Indy) September 16, 2010 Lecture 8 The Consensus Problem Reading: Paper on Website (Sections 1-3)  2010, I. Gupta

Lecture 8-2 Give it a thought Have you ever wondered why vendors of (distributed) software solutions always only offer solutions that promise five-9’s reliability, seven-9’s reliability, but never 100% reliability?

Lecture 8-3 Give it a thought Have you ever wondered why software vendors always only offer solutions that promise five-9’s reliability, seven-9’s reliability, but never 100% reliability? The fault does not lie with Microsoft Corp. or Apple Inc. or Cisco The fault lies in the impossibility of consensus

Lecture 8-4 What is Consensus? N processes Each process p has –input variable xp : initially either 0 or 1 –output variable yp : initially b (b=undecided) – can be changed only once Consensus problem: design a protocol so that either 1.all non-faulty processes set their output variables to 0 2.Or non-faulty all processes set their output variables to 1 3.There is at least one initial state that leads to each outcomes 1 and 2 above

Lecture 8-5 Solve Consensus! Uh, what’s the model? (assumptions!) Processes fail only by crash-stopping Synchronous system: bounds on –Message delays –Max time for each process step e.g., multiprocessor (common clock across processors) Asynchronous system: no such bounds! e.g., The Internet! The Web!

Lecture For a system with at most f processes crashing, the algorithm proceeds in f+1 rounds (with timeout), using basic multicast (B-multicast). - Values r i : the set of proposed values known to process p=P i at the beginning of round r. - Initially Values 0 i = {} ; Values 1 i = {v i =xp} for round r = 1 to f+1 do multicast (Values r i ) Values r+1 i  Values r i for each V j received Values r+1 i = Values r+1 i  V j end yp=d i = minimum(Values f+1 i ) Consensus in Synchronous Systems

Lecture 8-7 Why does the Algorithm Work? Proof by contradiction. Assume that two non-faulty processes differ in their final set of values. Suppose p i and p j are these processes. Assume that p i possesses a value v that p j does not possess.  In the last round, some third process, p k, sent v to p i, and crashed before sending v to p j.  Any process sending v in the penultimate round must have crashed; otherwise, both p k and p j should have received v.  Proceeding in this way, we infer at least one crash in each of the preceding rounds.  But we have assumed at most f crashes can occur and there are f+1 rounds ==> contradiction.

Lecture 8-8 Consensus in an Asynchronous System Messages have arbitrary delay, processes arbitrarily slow Impossible to achieve! –even a single failed is enough to avoid the system from reaching agreement! –a slow process indistinguishable from a crashed process Impossibility Applies to any protocol that claims to solve consensus! Proved in a now-famous result by Fischer, Lynch and Patterson, 1983 (FLP) –Stopped many distributed system designers dead in their tracks –A lot of claims of “reliability” vanished overnight

Lecture 8-9 Recall Each process p has a state –program counter, registers, stack, local variables –input register xp : initially either 0 or 1 –output register yp : initially b (b=undecided) Consensus Problem: design a protocol so that either 1.all non-faulty processes set their output variables to 0 2.Or non-faulty all processes set their output variables to 1 3.(No trivial solutions allowed)

Lecture 8-10 pp’ Global Message Buffer send(p’,m) receive(p’) may return null “Network”

Lecture 8-11 Different Definition of “State” State of a process Configuration: = Global state. Collection of states, one per process; and state of the global buffer Each Event consists atomically of three sub- steps: –receipt of a message by a process (say p), and –processing of message, and –sending out of all necessary messages by p (into the global message buffer) Note: this event is different from the Lamport events Schedule: sequence of events

Lecture 8-12 C C’ C’’ Event e’=(p’,m’) Event e’’=(p’’,m’’) Configuration C Schedule s=(e’,e’’) C C’’ Equivalent

Lecture 8-13 Lemma 1 C C’ C’’ Schedule s1 s2 Schedule s2 s1 s1 and s2 can each be applied to C involve disjoint sets of receiving processes Schedules are commutative

Lecture 8-14 State Valencies Let config. C have a set of decision values V reachable from it –If |V| = 2, config. C is bivalent –If |V| = 1, config. C is said to be 0-valent or 1-valent, as is the case Bivalent means outcome is unpredictable

Lecture 8-15 What we’ll Show 1.There exists an initial configuration that is bivalent 2.Starting from a bivalent config., there is always another bivalent config. that is reachable

Lecture 8-16 Lemma 2 Some initial configuration is bivalent Suppose all initial configurations were either 0-valent or 1-valent. Place all configurations side-by-side, where adjacent configurations differ in initial xp value for exactly one process. Creates a lattice of states There has to be some adjacent pair of 1-valent and 0-valent configs.

Lecture 8-17 Some initial configuration is bivalent There has to be some adjacent pair of 1-valent and 0-valent configs. Let the process p be the one with a different state across these two configs. Now consider the world where process p has crashed Both these initial configs. are indistinguishable. But one gives a 0 decision value. The other gives a 1 decision value. So, both these initial configs. are bivalent when there is a failure Lemma 2

Lecture 8-18 What we’ll Show 1.There exists an initial configuration that is bivalent 2.Starting from a bivalent config., there is always another bivalent config. that is reachable

Lecture 8-19 Lemma 3 Starting from a bivalent config., there is always another bivalent config. that is reachable

Lecture 8-20 A bivalent initial config. let e=(p,m) be an applicable event to the initial config. Let C be the set of configs. reachable without applying e Lemma 3 C

Lecture 8-21 A bivalent initial config. let e=(p,m) be an applicable event to the initial config. Let C be the set of configs. reachable without applying e e e e e e Let D be the set of configs. obtained by applying single event e to any config. in C Lemma 3 C

Lecture 8-22 [don’t apply event e=(p,m)] Lemma 3 D C e e e e e bivalent C

Lecture 8-23 Claim. Set D contains a bivalent config. Proof. By contradiction. That is, suppose D has only 0- and 1- valent states (and no bivalent ones) There are states D0 and D1 in D, and C0 and C1 in C such that –D0 is 0-valent, D1 is 1-valent –D0=C0 foll. by e=(p,m) –D1=C1 foll. by e=(p,m) –And C1 = C0 followed by some event e’=(p’,m’) (why?) D C e e e e e bivalent [don’t apply event e=(p,m)] C

Lecture 8-24 Proof. (contd.) Case I: p’ is not p Case II: p’ same as p D C e e e e e bivalent [don’t apply event e=(p,m)] C0 D1 D0C1 e e e’ Why? (Lemma 1) But D0 is then bivalent! C

Lecture 8-25 Proof. (contd.) Case I: p’ is not p Case II: p’ same as p D C e e e e e bivalent [don’t apply event e=(p,m)] C0 D1 D0 C1 e e’ A E0 e sch. s E1 sch. s (e’,e) e sch. s finite deciding run from C0 (i.e., A is not bivalent) p takes no steps But A is then bivalent!

Lecture 8-26 Lemma 3 Starting from a bivalent config., there is always another bivalent config. that is reachable

Lecture 8-27 Putting it all Together Lemma 2: There exists an initial configuration that is bivalent Lemma 3: Starting from a bivalent config., there is always another bivalent config. that is reachable Theorem (Impossibility of Consensus): There is always a run of events in an asynchronous distributed system (given any algorithm) such that the group of processes never reaches consensus (i.e., always stays bivalent) –“The devil’s advocate always has a way out”

Lecture 8-28 Why is Consensus Important? – Many problems in distributed systems are equivalent to (or harder than) consensus! –Agreement, e.g., on an integer (harder than consensus, since it can be used to solve consensus) is impossible! –Leader election is impossible! »A leader election algorithm can be designed using a given consensus algorithm as a black box »A consensus protocol can be designed using a given leader election algorithm as a black box –Accurate Failure Detection is impossible! »Should I mark a process that has not responded for the last 60 seconds as failed? (It might just be very, very, slow) »Completeness + Accuracy impossible to guarantee

Lecture 8-29 Summary Consensus Problem –agreement in distributed systems –Solution exists in synchronous system model (e.g., supercomputer) –Impossible to solve in an asynchronous system (e.g., Internet, Web) »Key idea: with only one process failure and arbitrarily slow processes, there are always sequences of events for the system to decide any which way. Regardless of which consensus algorithm is running underneath. –FLP impossibility proof

Lecture 8-30 Next Week Next Tuesday – HW2 due Next week: Peer to peer systems! –Read 2 papers on website »Gnutella »Chord (Sections 1-4, 6-7)

Lecture 8-31

Lecture 8-32 Why is Consensus Important? The impossibility of consensus means there exist no perfect solutions to any of the above problems in asynchronous system models –In an asynchronous system, there is no perfect algorithm for either failure detection, or leader election, or agreement How do we get around this? One way is to design Probabilistic Algorithms –E.g., probabilistic accuracy in failure detector algorithms

Lecture 8-33 Easier Consensus Problem Easier Consensus Problem: some process eventually sets yp to be 0 or 1 Only one process crashes – we’re free to choose which one Consensus Protocol correct if 1.No accessible config. (config. reachable from an initial config.) has > 1 decision value 2.For each v in {0,1}, there is an accessible config. (reachable from some initial state) that has value v –avoids trivial solution to the consensus problem