C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Consensus. One Reason: Impossibility of Consensus. Let s Consider This

Similar documents
Distributed Consensus

CS505: Distributed Systems

Coordination. Failures and Consensus. Consensus. Consensus. Overview. Properties for Correct Consensus. Variant I: Consensus (C) P 1. v 1.

CS505: Distributed Systems

Asynchronous Models For Consensus

Agreement Protocols. CS60002: Distributed Systems. Pallab Dasgupta Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur

Fault-Tolerant Consensus

Section 6 Fault-Tolerant Consensus

AGREEMENT PROBLEMS (1) Agreement problems arise in many practical applications:

Consensus. Consensus problems

Time. To do. q Physical clocks q Logical clocks

Simple Bivalency Proofs of the Lower Bounds in Synchronous Consensus Problems

Failure detectors Introduction CHAPTER

Valency Arguments CHAPTER7

Lower Bounds for Achieving Synchronous Early Stopping Consensus with Orderly Crash Failures

Distributed Systems Byzantine Agreement

Implementing Uniform Reliable Broadcast with Binary Consensus in Systems with Fair-Lossy Links

Impossibility of Distributed Consensus with One Faulty Process

Early stopping: the idea. TRB for benign failures. Early Stopping: The Protocol. Termination

Finally the Weakest Failure Detector for Non-Blocking Atomic Commit

Shared Memory vs Message Passing

Failure Detectors. Seif Haridi. S. Haridi, KTHx ID2203.1x

Clock Synchronization

The Weakest Failure Detector to Solve Mutual Exclusion

Reliable Broadcast for Broadcast Busses

Agreement. Today. l Coordination and agreement in group communication. l Consensus

On the weakest failure detector ever

Distributed Systems Principles and Paradigms. Chapter 06: Synchronization

Time in Distributed Systems: Clocks and Ordering of Events

Distributed Systems Principles and Paradigms

Quantum Algorithms for Leader Election Problem in Distributed Systems

Eventually consistent failure detectors

Failure Detection and Consensus in the Crash-Recovery Model

Do we have a quorum?

Failure detection and consensus in the crash-recovery model

Information-Theoretic Lower Bounds on the Storage Cost of Shared Memory Emulation

Easy Consensus Algorithms for the Crash-Recovery Model

DISTRIBUTED COMPUTER SYSTEMS

Abstract. The paper considers the problem of implementing \Virtually. system. Virtually Synchronous Communication was rst introduced

arxiv: v2 [cs.dc] 18 Feb 2015

Slides for Chapter 14: Time and Global States

Genuine atomic multicast in asynchronous distributed systems

CS 425 / ECE 428 Distributed Systems Fall Indranil Gupta (Indy) Oct. 5, 2017 Lecture 12: Time and Ordering All slides IG

Atomic m-register operations

CS 347 Parallel and Distributed Data Processing

Time. Today. l Physical clocks l Logical clocks

Network Algorithms and Complexity (NTUA-MPLA) Reliable Broadcast. Aris Pagourtzis, Giorgos Panagiotakos, Dimitris Sakavalas

CS505: Distributed Systems

Optimal and Player-Replaceable Consensus with an Honest Majority Silvio Micali and Vinod Vaikuntanathan

1 Introduction. 1.1 The Problem Domain. Self-Stablization UC Davis Earl Barr. Lecture 1 Introduction Winter 2007

Byzantine Agreement. Gábor Mészáros. CEU Budapest, Hungary

Distributed Computing in Shared Memory and Networks

Optimal Resilience Asynchronous Approximate Agreement

Early consensus in an asynchronous system with a weak failure detector*

Unreliable Failure Detectors for Reliable Distributed Systems

Logical Time. 1. Introduction 2. Clock and Events 3. Logical (Lamport) Clocks 4. Vector Clocks 5. Efficient Implementation

Consensus and Universal Construction"

On the weakest failure detector ever

Byzantine Agreement. Gábor Mészáros. Tatracrypt 2012, July 2 4 Smolenice, Slovakia. CEU Budapest, Hungary

6.852: Distributed Algorithms Fall, Class 24

6.852: Distributed Algorithms Fall, Class 10

Clocks in Asynchronous Systems

Eventual Leader Election with Weak Assumptions on Initial Knowledge, Communication Reliability, and Synchrony

Model Checking of Fault-Tolerant Distributed Algorithms

How to solve consensus in the smallest window of synchrony

Towards optimal synchronous counting

Faster Agreement via a Spectral Method for Detecting Malicious Behavior

The Weighted Byzantine Agreement Problem

Consensus when failstop doesn't hold

Colorless Wait-Free Computation

The Byzantine Generals Problem Leslie Lamport, Robert Shostak and Marshall Pease. Presenter: Jose Calvo-Villagran

On the Minimal Synchronism Needed for Distributed Consensus

Crashed router. Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education

Time Synchronization

Common Knowledge and Consistent Simultaneous Coordination

Time. Lakshmi Ganesh. (slides borrowed from Maya Haridasan, Michael George)

Randomized Protocols for Asynchronous Consensus

Our Problem. Model. Clock Synchronization. Global Predicate Detection and Event Ordering

416 Distributed Systems. Time Synchronization (Part 2: Lamport and vector clocks) Jan 27, 2017

THE chase for the weakest system model that allows

Byzantine Agreement in Polynomial Expected Time

Distributed systems Lecture 4: Clock synchronisation; logical clocks. Dr Robert N. M. Watson

1 Lamport s Bakery Algorithm

Announcements Monday, September 18

On the Number of Synchronous Rounds Required for Byzantine Agreement

Degradable Agreement in the Presence of. Byzantine Faults. Nitin H. Vaidya. Technical Report #

Byzantine behavior also includes collusion, i.e., all byzantine nodes are being controlled by the same adversary.

Byzantine Agreement. Chapter Validity 190 CHAPTER 17. BYZANTINE AGREEMENT

How can one get around FLP? Around FLP in 80 Slides. How can one get around FLP? Paxos. Weaken the problem. Constrain input values

Chandy-Lamport Snapshotting

The Heard-Of Model: Computing in Distributed Systems with Benign Failures

MAD. Models & Algorithms for Distributed systems -- 2/5 -- download slides at

A Note on Turing Machine Design

Approximation of δ-timeliness

ROBUST & SPECULATIVE BYZANTINE RANDOMIZED CONSENSUS WITH CONSTANT TIME COMPLEXITY IN NORMAL CONDITIONS

CS3110 Spring 2017 Lecture 21: Distributed Computing with Functional Processes

A Realistic Look At Failure Detectors

Absence of Global Clock

FAIRNESS FOR DISTRIBUTED ALGORITHMS

Protocol for Asynchronous, Reliable, Secure and Efficient Consensus (PARSEC)

Transcription:

Recap: Finger Table Finding a <key, value> using fingers Distributed Systems onsensus Steve Ko omputer Sciences and Engineering University at Buffalo N102 86 + 2 4 N86 20 + 2 6 N20 2 Let s onsider This One Reason: Impossibility of onsensus Q: Should Steve give an A to everybody taking SE 486/586? Input: everyone says either yes/no. Output: an agreement of yes or no. Bad news Asynchronous systems cannot guarantee that they will reach consensus even with one faulty process. Many consensus problems Reliable, totally-ordered multicast (what we saw already) Mutual exclusion, leader election, etc. (what we will see) annot reach consensus. 3 4 The onsensus Problem Assumptions (System Model) N processes Each process p has input variable x p : initially either 0 or 1 output variable y p : initially b (b=undecided) can be changed only once onsensus problem: Design a protocol so that either all non-faulty processes set their output variables to 0 Or all non-faulty processes set their output variables to 1 There is at least one initial state that leads to each outcomes 1 and 2 above 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 5 6 1

Example: State Machine Replication Run multiple copies of a state machine For what? Reliability All copies agree on the order of execution. Many mission-critical systems operate like this. Air traffic control systems, Warship control systems, etc. First: Synchronous Systems Every process starts with an initial input value (0 or 1). Every process keeps the history of values received so far. The protocol proceeds in rounds. At each round, everyone multicasts the history of values. After all the rounds are done, pick the minimum. 7 8 First: Synchronous Systems 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 =x p } 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 end Why Does It Work? Assume that two non-faulty processes differ in their final set of values à proof by contradiction Suppose p i and p j are these processes. Assume that p i possesses a value v that p j does not possess. Intuition: p j must have consistently missed v in all rounds. Let s backtrack this. à 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 y p =d i = minimum(values f+1 i ) there are f+1 rounds ==> contradiction. 9 10 Second: Asynchronous Systems Messages have arbitrary delay, processes arbitrarily slow Impossible to achieve consensus 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 Are We Doomed? Asynchronous systems (i.e., systems with arbitrary delay) cannot guarantee that they will reach consensus even with one faulty process. Key word: guarantee Does not mean that processes can never reach a consensus if one is faulty Allows room for reaching agreement with some probability greater than zero In practice many systems reach consensus. How to get around this? Two key things in the result: one faulty process & arbitrary delay 11 12 2

Techniques to Overcome Impossibility Technique 1: masking faults (crash-stop) For example, use persistent storage and keep local checkpoints Then upon a failure, restart the process and recover from the last checkpoint. This masks fault, but may introduce arbitrary delays. Technique 2: using failure detectors For example, if a process is slow, mark it as a failed process. Then actually kill it somehow, or discard all the messages from that point on (fail-silent) This effectively turns an asynchronous system into a synchronous system Failure detectors might not be 100% accurate and requires a long timeout value to be reasonably accurate. Administrivia PA2-B due on Friday (3/11) Please do not use someone else s code! Midterm on Wednesday (3/9) heat sheet allowed (letter-sized, front-and-back) Recitations this Friday and next Monday for undergrads 13 14 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) onsensus Problem: Design a protocol so that either all non-faulty processes set their output variables to 0 Or non-faulty all processes set their output variables to 1 (No trivial solutions allowed) Proof of Impossibility: Reminder State machine Forget real time, everything is in steps & state transitions. Equally applicable to a single process as well as distributed processes A state (S1) is reachable from another state (S0) if there is a sequence of events from S0 to S1. There an initial state with an initial set of input values. 15 16 Different Definition of State p p send(p,m) receive(p ) may return null Global Message Buffer Network State of a process onfiguration: = Global state. ollection 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 17 18 3

onfiguration Event e =(p,m ) Event e =(p,m ) Schedule s=(e,e ) State Valencies Let config. have a set of decision values V reachable from it If V = 2, config. is bivalent If V = 1, config. is said to be 0-valent or 1-valent, as is the case Bivalent means that the outcome is unpredictable (but still doesn t mean that consensus is not guaranteed). Three possibilities: Unanimous 0 Unanimous 1 0 s and 1 s Equivalent 19 20 Guaranteeing onsensus Lemma 1 If we want to say that a protocol guarantees consensus (with one faulty process & arbitrary delays), we should be able to say the following: onsider all possible input sets (i.e., all initial configurations). For each input set (i.e., for each initial configuration), the protocol should produce either 0 or 1 even with one failure for all possible execution paths (runs). I.e., no 0 s and 1 s The impossibility result: We can t do that. I.e., there is always a run that will produce 0 s and 1 s. s1 and s2 Schedule s1 can each be applied to involve disjoint sets of receiving processes Schedules are commutative 21 s2 Schedule s2 s1 22 The Theorem 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 Insight: It is not possible to distinguish a faulty node from a slow node. Theorem (Impossibility of onsensus): 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) Summary onsensus: reaching an agreement Possible in synchronous systems Asynchronous systems cannot guarantee. Asynchronous systems cannot guarantee that they will reach consensus even with one faulty process. 23 24 4

Acknowledgements These slides contain material developed and copyrighted by Indranil Gupta (UIU). 25 5