Atomic register algorithms

Slides:



Advertisements
Similar presentations
Distributed systems Total Order Broadcast Prof R. Guerraoui Distributed Programming Laboratory.
Advertisements

A General Characterization of Indulgence R. Guerraoui EPFL joint work with N. Lynch (MIT)
1 Distributed systems Causal Broadcast Prof R. Guerraoui Distributed Programming Laboratory.
1 © R. Guerraoui The Power of Registers Prof R. Guerraoui Distributed Programming Laboratory.
Time and Global States Part 3 ECEN5053 Software Engineering of Distributed Systems University of Colorado, Boulder.
(c) Oded Shmueli Distributed Recovery, Lecture 7 (BHG, Chap.7)
1 © R. Guerraoui Implementing the Consensus Object with Timing Assumptions R. Guerraoui Distributed Programming Laboratory.
1 © P. Kouznetsov On the weakest failure detector for non-blocking atomic commit Rachid Guerraoui Petr Kouznetsov Distributed Programming Laboratory Swiss.
Failure Detectors. Can we do anything in asynchronous systems? Reliable broadcast –Process j sends a message m to all processes in the system –Requirement:
CIS 720 Concurrency Control. Timestamp-based concurrency control Assign a timestamp ts(T) to each transaction T. Each data item x has two timestamps:
1 © R. Guerraoui Object implementations out of faulty base objects Prof R. Guerraoui Distributed Programming Laboratory.
1 © R. Guerraoui - Shared Memory - R. Guerraoui Distributed Programming Laboratory lpdwww.epfl.ch.
CS 582 / CMPE 481 Distributed Systems Fault Tolerance.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Distributed Snapshots –Termination detection Election algorithms –Bully –Ring.
Distributed Algorithms (22903) Lecturer: Danny Hendler Shared objects: linearizability, wait-freedom and simulations Most of this presentation is based.
Computer Science Lecture 11, page 1 CS677: Distributed OS Last Class: Clock Synchronization Logical clocks Vector clocks Global state.
1 Principles of Reliable Distributed Systems Recitation 8 ◊S-based Consensus Spring 2009 Alex Shraer.
Aran Bergman, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Recitation 5: Reliable.
 Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 12: Impossibility.
Distributed Systems Terminating Reliable Broadcast Prof R. Guerraoui Distributed Programming Laboratory.
Composition Model and its code. bound:=bound+1.
Midterm Exam 06: Exercise 2 Atomic Shared Memory.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms.
6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.
Failure detection and consensus Ludovic Henrio CNRS - projet OASIS Distributed Algorithms.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms –Bully algorithm.
1 © R. Guerraoui Regular register algorithms R. Guerraoui Distributed Programming Laboratory lpdwww.epfl.ch.
Totally Ordered Broadcast in the face of Network Partitions [Keidar and Dolev,2000] INF5360 Student Presentation 4/3-08 Miran Damjanovic
Distributed systems Consensus Prof R. Guerraoui Distributed Programming Laboratory.
1 © R. Guerraoui Registers Prof R. Guerraoui Distributed Programming Laboratory.
Replication Improves reliability Improves availability ( What good is a reliable system if it is not available?) Replication must be transparent and create.
“Distributed Algorithms” by Nancy A. Lynch SHARED MEMORY vs NETWORKS Presented By: Sumit Sukhramani Kent State University.
Distributed Algorithms (22903) Lecturer: Danny Hendler Shared objects: linearizability, wait-freedom and simulations Most of this presentation is based.
1 © R. Guerraoui Set-Agreement (Generalizing Consensus) R. Guerraoui.
EEC 688/788 Secure and Dependable Computing Lecture 10 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Distributed systems Causal Broadcast
Synchronization: Distributed Deadlock Detection
6.4 Data and File Replication
Computing with anonymous processes
CSE 486/586 Distributed Systems Failure Detectors
Byzantine-Resilient Colorless Computaton
ITEC452 Distributed Computing Lecture 9 Global State Collection
Distributed systems Total Order Broadcast
Lecture 16-A: Impossibility of Consensus
Replication and Consistency
Replication and Consistency
EEC 688/788 Secure and Dependable Computing
Replication Improves reliability Improves availability
EEC 688/788 Secure and Dependable Computing
Distributed systems Reliable Broadcast
Chapter 5 (through section 5.4)
Distributed Algorithms (22903)
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
Distributed systems Causal Broadcast
Constructing Reliable Registers From Unreliable Byzantine Components
Distributed Algorithms (22903)
- Atomic register specification -
R. Guerraoui Distributed Programming Laboratory lpdwww.epfl.ch
Computing with anonymous processes
CIS825 Lecture 5 1.
Distributed systems Consensus
CSE 486/586 Distributed Systems Failure Detectors
Broadcasting with failures
CIS 720 Concurrency Control.
Distributed Systems Terminating Reliable Broadcast
Replication and Consistency
Distributed systems Causal Broadcast
R. Guerraoui Distributed Programming Laboratory lpdwww.epfl.ch
Fault-Tolerant SemiFast Implementations of Atomic Read/Write Registers
Presentation transcript:

Atomic register algorithms R. Guerraoui Distributed Programming Laboratory lpdwww.epfl.ch © R. Guerraoui

Overview of this lecture (1) From regular to atomic (2) A 1-1 atomic fail-stop algorithm (3) A 1-N atomic fail-stop algorithm (4) A N-N atomic fail-stop algorithm (5) From fail-stop to fail-silent

Fail-stop algorithms We first assume a fail-stop model; more precisely: any number of processes can fail by crashing (no recovery) channels are reliable failure detection is perfect

The simple algorithm Consider our fail-stop regular register algorithm every process has a local copy of the register value every process reads locally the writer writes globally, i.e., at all (non-crashed) processes

The simple algorithm Write(v) at pi At pi: when receive [W,v] from pj send [W,v] to all for every pj, wait until either: received [ack] or suspected [pj] Return ok At pi: when receive [W,v] from pj vi := v send [ack] to pj Read() at pi Return vi

Atomicity? R1() -> 5 R2() -> 6 P1 P2 W(5) W(6) R3() -> 5 P3 v1 = 5 v1 = 6 P2 W(5) W(6) R3() -> 5 P3 v3 = 5

Linearization? R1() -> 5 R2() -> 6 P1 W(5) W(6) P2

Fixing the pb: read-globally Read() at pi send [W,vi] to all for every pj, wait until either: receive [ack] or suspect [pj] Return vi

Still a problem R() -> 5 P1 W(5) W(6) P2 R() -> 5 P3

Linearization? R1() -> 5 P1 W(5) W(6) P2 R3() -> 5 ?? P3

Overview of this lecture (1) From regular to atomic (2) A 1-1 atomic fail-stop algorithm (3) A 1-N atomic fail-stop algorithm (4) A N-N atomic fail-stop algorithm (5) From fail-stop to fail-silent

A fail-stop 1-1 atomic algorithm Write(v) at p1 send [W,v] to p2 Wait until either: receive [ack] from p2 or suspect [p2] Return ok At p2: when receive [W,v] from p1 v2 := v send [ack] to p2 Read() at p2 Return v2

A fail-stop 1-N algorithm every process maintains a local value of the register as well as a sequence number the writer, p1, maintains, in addition a timestamp ts1 any process can read in the register

A fail-stop 1-N algorithm Write(v) at p1 ts1++ send [W,ts1,v] to all for every pi, wait until either: receive [ack] or suspect [pi] Return ok Read() at pi send [W,sni,vi] to all for every pj, wait until either: receive [ack] or suspect [pj] Return vi

A 1-N algorithm (cont’d) At pi When pi receive [W,ts,v] from pj if ts > sni then vi := v sni := ts send [ack] to pj

Why not N-N? R() -> Y P1 W(Y) W(X) P2 W(Z) P3

The Write() algorithm Write(v) at pi T1: T2: At pi send [W] to all for every pj wait until receive [W,snj] or suspect pj (sn,id) := (highest snj + 1,i) send [W,(sn,id),v] to all receive [W,(sn,id),ack] or Return ok At pi T1: when receive [W] from pj send [W,sn] to pj T2: when receive [W,(snj,idj),v] from pj If (snj,idj) > (sn,id) then vi := v (sn,id) := (snj,idj) send [W,(snj,idj),ack] to pj

The Read() algorithm Read() at pi T1: T2: At pi send [R] to all for every pj wait until receive [R,(snj,idj),vj] or suspect pj v = vj with the highest (snj,idj) (sn,id) = highest (snj,idj) send [W,(sn,id),v] to all receive [W,(sn,id),ack] or Return v At pi T1: when receive [R] from pj send [R,(sn,id),vi] to pj T2: when receive [W,(snj,idj),v] from pj If (snj,idj) > (sn,id) then vi := v (sn,id) := (snj,idj) send [W,(snj,idj),ack] to pj

Overview of this lecture (1) From regular to atomic (2) A 1-1 atomic fail-stop algorithm (3) A 1-N atomic fail-stop algorithm (4) A N-N atomic fail-stop algorithm (5) From fail-stop to fail-silent

From fail-stop to fail-silent We assume a majority of correct processes In the 1-N algorithm, the writer writes in a majority using a timestamp determined locally and the reader selects a value from a majority and then imposes this value on a majority In the N-N algorithm, the writers determines first the timestamp using a majority