1 Consensus Hierarchy Part 2. 2 FIFO (Queue) FIFO Object headtail.

Slides:



Advertisements
Similar presentations
Impossibility of Distributed Consensus with One Faulty Process
Advertisements

Lecture 3 Universal TM. Code of a DTM Consider a one-tape DTM M = (Q, Σ, Γ, δ, s). It can be encoded as follows: First, encode each state, each direction,
1 © R. Guerraoui The Limitations of Registers R. Guerraoui Distributed Programming Laboratory.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Consensus Steve Ko Computer Sciences and Engineering University at Buffalo.
Prof. Jennifer Welch 1. FIFO Queue Example 2  Sequential specification of a FIFO queue:  operation with invocation enq(x) and response ack  operation.
CPSC 668Set 18: Wait-Free Simulations Beyond Registers1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
6.852: Distributed Algorithms Spring, 2008 Class 16.
Distributed Computing 8. Impossibility of consensus Shmuel Zaks ©
Announcements. Midterm Open book, open note, closed neighbor No other external sources No portable electronic devices other than medically necessary medical.
Distributed Computing 8. Impossibility of consensus Shmuel Zaks ©
CPSC 668Set 19: Asynchronous Solvability1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
1 Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible.
CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
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 The Chomsky Hierarchy. 2 Unrestricted Grammars: Rules have form String of variables and terminals String of variables and terminals.
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
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.
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
CPSC 668Set 11: Asynchronous Consensus1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
CPSC 668Set 11: Asynchronous Consensus1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
Prof. Busch - LSU1 Pumping Lemma for Context-free Languages.
On the Cost of Fault-Tolerant Consensus When There are no Faults Idit Keidar & Sergio Rajsbaum Appears in SIGACT News; MIT Tech. Report.
1 Applications of Regular Closure. 2 The intersection of a context-free language and a regular language is a context-free language context free regular.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
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.
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.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 11: Asynchronous Consensus 1.
For Distributed Algorithms 2014 Presentation by Ziv Ronen Based on “Impossibility of Distributed Consensus with One Faulty Process” By: Michael J. Fischer,
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 18: Wait-Free Simulations Beyond Registers 1.
Consensus and Its Impossibility in Asynchronous Systems.
1 Chapter 9 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Synchronization Algorithms and Concurrent Programming Synchronization.
DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch Set 11: Asynchronous Consensus 1.
1 Consensus Hierarchy Part 1. 2 Consensus in Shared Memory Consider processors in shared memory: which try to solve the consensus problem.
Wait-Free Consensus CPSC 661 Fall 2003 Supervised by: Lisa Higham Presented by: Wei Wei Zheng Nuha Kamaluddeen.
CS294, Yelick Consensus revisited, p1 CS Consensus Revisited
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Costas Busch - LSU1 Pumping Lemma for Context-free Languages.
Impossibility of Distributed Consensus with One Faulty Process By, Michael J.Fischer Nancy A. Lynch Michael S.Paterson.
Chapter 21 Asynchronous Network Computing with Process Failures By Sindhu Karthikeyan.
Distributed Algorithms (22903) Lecturer: Danny Hendler The wait-free hierarchy and the universality of consensus This presentation is based on the book.
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.
1 Fault-Tolerant Consensus. 2 Communication Model Complete graph Synchronous, network.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Decidability.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Distributed Algorithms (22903)
The consensus problem in distributed systems
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Alternating Bit Protocol
Distributed Consensus
Decidable Languages Costas Busch - LSU.
Deterministic PDAs - DPDAs
Pumping Lemma for Context-free Languages
Distributed Algorithms (22903)
Distributed Algorithms (22903)
The Relative Power of Synchronization Methods
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Deterministic Objects: Life Beyond Consensus
Applications of Regular Closure
More Undecidable Problems
Presentation transcript:

1 Consensus Hierarchy Part 2

2 FIFO (Queue) FIFO Object headtail

3 Special case: empty queue tailhead

4 Theorem: A FIFO object has consensus number 2 Proof: 1.We can solve wait-free consensus using FIFO (and read/write) objects for 2 processes 2. We cannot solve wait-free consensus using FIFO (and read/write) variables for 3 or more processes

5 A Wait-Free Consensus algorithm for 2 processors using a FIFO object (and read/write objects) Initially: tailhead Proof-Part 1

6 Shared Memory Queue Other Variables tail head

7 Local variables :initial values for the consensus problem :resulting values for the consensus problem

8 Shared Memory Queue Other Variables tail head Initial values

9 Code for processor If then else //am I the first? //yes, choose my value //no, choose the other processor’s value Note: the algorithm uses a FIFO object and read/write objects

10 Example execution: Shared Memory Queue tail head

11 Suppose that accesses first the queue Shared Memory Queue tail head decides on its own value

12 Suppose that accesses second Shared Memory Queue tail head decides on the other processor’s value Consensus Reached

13 There is no wait-free consensus algorithm using only FIFO (and read-write) objects for Consider three processors (the same proof generalizes to more) Proof-Part 2 We will prove:

14 There is a bivalent initial configuration (we proved it before) We will show that every bivalent configuration has a processor which is not critical Therefore, we can construct an infinite execution with bivalent configurations where consensus is never reached

15 Assume for contradiction that all processors are critical bivalent univalent Possible executions

16 bivalent valent It cannot be that all have the same valence valent Contradiction

17 There must exist two processors with different valences bivalent univalent

18 Shared Memory Queue Read/Write Objects

19 Shared Memory Queue Read/Write Objects bivalent Case: the processors access different objects Note: if an object was read/write the analysis is the similar univalent

20 bivalent op Q1 op Q2 op Q1 Impossible since Two possible executions univalent

21 Shared Memory Queue Read/Write Objects bivalent Case: the processors access same object Note: if the object was read/write the analysis is the same as in the case with read/write objects univalent

22 bivalent univalent deq(Q) Subcase: deq/deq

23 bivalent univalent deq(Q) Impossible since Queue Q before operations:

24 bivalent univalent deq(Q) enq(Q,x) Subcase: deq/enq

25 bivalent univalent deq(Q) enq(Q,x) deq(Q) Impossible since Suppose Q was not empty

26 bivalent univalent deq(Q) enq(Q,x) Impossible since Suppose Q was empty

27 bivalent univalent enq(Q,a) enq(Q,b) Subcase: enq/enq

28 bivalent univalent enq(Q,a) enq(Q,b) enq(Q,a) Suppose Q was not empty

29 bivalent univalent enq(Q,a) enq(Q,b) enq(Q,a) enq(Q,b) Dequeue aDequeue b Dequeue a Impossible since

30 bivalent enq(Q,a) enq(Q,b) decides Suppose does not dequeue a A decision will be reached since the consensus algorithm is wait-free Explanation

31 bivalent enq(Q,a) enq(Q,b) enq(Q,a) enq(Q,b) The same value will be decided by, since sees the same shared memory values in both executions decides contradiction

32 In all cases we obtained contradiction; Therefore, there exists a processor which is not critical bivalent univalent bivalent (not critical)

33 Therefore, we can construct an execution Initial configuration Never ends bivalent Consensus can never be reached End of Theorem Proof

34 Compare&Swap Compare&Swap(X,A,B) { Temp X; If X==A then X B; Return Temp; } Shared Memory X

35 Theorem:The consensus number of the Compare&Swap object is Proof: Given processes, for any, we can solve wait-free consensus using a Compare&Swap object (and read/write objects)

36 A Wait-Free Consensus algorithm for n processors using a compare&swap object Shared Memory First Local Memory (compare&swap object) Initial value Final value

37 Code for processor If then else //am I the first? //yes, choose my value Note: the algorithm uses a compare&swap and read/write objects //no, choose the value of the first process which is stored in First

38 Shared Memory First Local Memory Example execution:

39 Local Memory Suppose executes first Compare&Swap(First,,0) Shared Memory First

40 Local Memory Suppose executes first Shared Memory First Realizes it is first, decides on its own value

41 Local Memory Suppose executes second Compare&Swap(First,,1) Shared Memory First

42 Local Memory Shared Memory First Realizes is not first, decides on value of First Suppose executes second

43 Local Memory Shared Memory First Realizes is not first, decides on value of First Similarly for Consensus has been reached

44 The algorithm is wait-free, since after the completion of the Compare&Swap operation, every processor decides (without considering what the other processors do)

45 Consensus Hierarchy Part 3

46 Consensus Number Consensus Number of an object type: The maximum number of processes for which the object can be used to solve the wait-free consensus problem (together with read/write objects)

47 Object TypeConsensus Number Read/Write 1 FIFO 2 Compare&Swap (infinity)

48 Simulation: Object Type B Object Type A Read/Write Object Object of type A simulates object of Type B

49 Theorem:Objects of type A with consensus number cannot simulate another object of type B with consensus number Proof: Since otherwise, object A would have consensus number End of Proof

50 Universality can simulate in a wait-free manner any other arbitrary object Universal object:

51 Objects with consensus number can simulate in a wait-free manner any other arbitrary object of up to processors We can show:

52 new-state Compare&Swap inv response before new-state inv response before initial head anchor Non-Blocking Simulation

53 new-state Consensus Object inv response after new-state inv response after initial Head anchor Non-Blocking Simulation seq 1

54 new-state inv response after Announce seq Wait-free Simulation