1 Consensus Hierarchy Part 1. 2 Consensus in Shared Memory Consider processors in shared memory: which try to solve the consensus problem.

Slides:



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

CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Consensus Steve Ko Computer Sciences and Engineering University at Buffalo.
Process Synchronization Continued 7.2 The Critical-Section Problem.
Mutual Exclusion By Shiran Mizrahi. Critical Section class Counter { private int value = 1; //counter starts at one public Counter(int c) { //constructor.
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 ©
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Consensus Steve Ko Computer Sciences and Engineering University at Buffalo.
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.
Parallel Processing (CS526) Spring 2012(Week 6).  A parallel algorithm is a group of partitioned tasks that work with each other to solve a large problem.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Self Stabilization 1.
Distributed Computing 8. Impossibility of consensus Shmuel Zaks ©
CPSC 668Set 19: Asynchronous Solvability1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
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.
CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2006 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:
CPSC 668Self Stabilization1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
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.
On the Cost of Fault-Tolerant Consensus When There are no Faults Idit Keidar & Sergio Rajsbaum Appears in SIGACT News; MIT Tech. Report.
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.
Distributed Algorithms – 2g1513 Lecture 9 – by Ali Ghodsi Fault-Tolerance in Distributed Systems.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 11: Asynchronous Consensus 1.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 19: Asynchronous Solvability 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.
28/10/1999POS-A1 The Synchronization Problem Synchronization problems occur because –multiple processes or threads want to share data; –the executions.
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.
THIRD PART Algorithms for Concurrent Distributed Systems: The Mutual Exclusion problem.
DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE
CS294, Yelick Consensus revisited, p1 CS Consensus Revisited
Distributed systems Consensus Prof R. Guerraoui Distributed Programming Laboratory.
1 Consensus Hierarchy Part 2. 2 FIFO (Queue) FIFO Object headtail.
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.
Hwajung Lee. Why do we need these? Don’t we already know a lot about programming? Well, you need to capture the notions of atomicity, non-determinism,
Impossibility of Distributed Consensus with One Faulty Process By, Michael J.Fischer Nancy A. Lynch Michael S.Paterson.
Agreement in Distributed Systems n definition of agreement problems n impossibility of consensus with a single crash n solvable problems u consensus with.
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.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 9 Instructor: Haifeng YU.
1 Fault-Tolerant Consensus. 2 Communication Model Complete graph Synchronous, network.
“Distributed Algorithms” by Nancy A. Lynch SHARED MEMORY vs NETWORKS Presented By: Sumit Sukhramani Kent State University.
6.852: Distributed Algorithms Spring, 2008 Class 14.
Chapter 10 Mutual Exclusion Presented by Yisong Jiang.
CSE 486/586 CSE 486/586 Distributed Systems Consensus Steve Ko Computer Sciences and Engineering University at Buffalo.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Algebraic Topology and Distributed Computing part two
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Designing Parallel Algorithms (Synchronization)
Alternating Bit Protocol
Distributed Consensus
Distributed Consensus
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
FLP Impossibility of Consensus
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Presentation transcript:

1 Consensus Hierarchy Part 1

2 Consensus in Shared Memory Consider processors in shared memory: which try to solve the consensus problem

3 Every process starts with an initial value stored in local memory (0 or 1) Shared memory Local memory Local memory

4 communication through shared memory

5 At the end of execution, every process has decided the same value (0 or 1)

6 Validity condition: If every process starts with the same value, the every process should decide that value Additional condition: The decided value is one of the initial values

7 Wait-freedom in asynchronous systems: A process should be able to finish execution of an algorithm even if all other processes fail Wait-freedom captures: Asynchronous executions Crash failures

8 Object Types Read/Write FIFO Compare&Swap Test&Set n-register assignment

9 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)

10 Object TypeConsensus Number Read/Write 1 FIFO, Test&Set 2 Compare&Swap (infinity) n-register assignment2n-2

11 int compare_and_swap ( int* register, int oldval, int newval) { int old_reg_val = *register; if (old_reg_val == oldval) *register = newval; return old_reg_val; } int Test-and-Set(boolean lock) { boolean initial = lock; lock = true; return initial; } (Shared ) boolean lock = false; function Critical_Section() { while TestAndSet(lock) skip //spin until lock is acquired //Critical-section code - only one process can be in this section at a time begin { … } //end-of critical section – release lock lock = false //release lock when finished with the critical section } Mutual Exclusion

12 Simulation: Object Type B Object Type A Read/Write Object Object of type A simulates object of Type B (using auxiliary read/write objects)

13 Theorem:Objects of Type A with consensus number cannot simulate in wait-free manner another object of Type B with consensus number Proof: Since otherwise, object A would have consensus number End of Proof

14 can simulate in a wait-free manner any other arbitrary object Universal object: Compare&SwapExample: (infinity consensus number)

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

16 Read/Write Shared Memory Suppose that the shared memory can only be accessed through Read or Write operations

17 Theorem: Proof of Theorem: The consensus number of the Read/Write object is 1 Trivially, any consensus algorithm with 1 process using read/write variables is wait-free.

18 Wait-free consensus cannot be solved using only read/write objects for processors It remains to show: We will show that any algorithm that solves wait-free consensus for has an execution that never terminates Approach:

19 System configuration: Is the set of all variables in the system, including local and shared

20 A distributed system execution can be always be viewed as a: sequence of configurations Initial configuration Final configuration Processor action: Read or Write

21 bivalent univalent bivalent Valence of system configurations 1-valent 0-valent Consensus value at possible execution paths consensus reached consensus not reached consensus reached

22 A terminating execution: Initial configuration Bivalent Univalent Bivalent Final configuration

23 To prove the theorem, we will show that there is always an execution where every configuration is bivalent Initial configuration Bivalent Never-ending execution Bivalent

24 Similar configurations for processor Same shared variables Local variables of others may differ

25 Lemma:If there exist univalent configurations and such that then if is -valent then is -valent too Proof of Lemma:

26 Univalent Execution with only taking actions All possible executions from final decision for each Possible execution

27 Univalent Execution with only taking actions Univalent Execution with only taking actions

28 Univalent Execution with only taking actions Univalent Execution with only taking actions

29 Univalent Execution with only taking actions Univalent Execution with only taking actions End of Lemma Proof

30 Lemma: There exists a bivalent initial configuration Proof of Lemma:

31 Possible Initial Configurations Shared Memory Empty Local Memory Initial Configuration

32 Possible Initial Configurations Shared Memory Empty Local Memory 0-valent1-valent ? Initial Configuration

33 Possible Initial Configurations Shared Memory Empty Local Memory 0-valent1-valent1-valent? No, because Initial Configuration

34 Possible Initial Configurations Shared Memory Empty Local Memory 0-valent1-valent0-valent? No, because Initial Configuration

35 Possible Initial Configurations Shared Memory Empty Local Memory 0-valent1-valentbivalent End of Lemma Proof Initial Configuration

36 Critical processor for a configuration: the configuration is bivalent, and after the processor takes step the configuration becomes univalent BivalentUnivalent

37 Lemma: If is a bivalent configuration then, there is at least one processor which is not critical Proof of Lemma:

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

39 bivalent valent It cannot be that all have the same valence valent

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

41 bivalent There must exist two processors with different valences

42 bivalent Case 1: suppose that they access different shared variables Read x Read y x y

43 bivalent Read x Read y two possible executions Read y Read x impossible since different valence

44 same result holds for any kind of operation (Read or Write) that the processors apply to x and y

45 bivalent Case 2: suppose that they access the same shared variable Read x x subcase: read/read

46 two possible executions bivalent Read x impossible since different valence

47 bivalent Read x Write x subcase: read/write

48 two possible executions bivalent Read x Write x Read x impossible since different valence

49 subcase: write/write bivalent Write x impossible since different valence

50 In all cases we obtained contradiction Therefore, there exists a processor which is not critical bivalent univalent bivalent (not critical) End of Lemma Proof

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