Distributed Algorithms (22903)

Slides:



Advertisements
Similar presentations
1 © R. Guerraoui The Limitations of Registers R. Guerraoui Distributed Programming Laboratory.
Advertisements

1 © R. Guerraoui The Power of Registers Prof R. Guerraoui Distributed Programming Laboratory.
CPSC 668Set 18: Wait-Free Simulations Beyond Registers1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Self Stabilization 1.
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.
A Mile-High View of Concurrent Algorithms Hagit Attiya Technion.
CPSC 668Set 16: Distributed Shared Memory1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
CPSC 668Set 12: Causality1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
CPSC 668Set 17: Fault-Tolerant Register Simulations1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
Distributed Algorithms (22903) Lecturer: Danny Hendler Shared objects: linearizability, wait-freedom and simulations Most of this presentation is based.
CPSC 668Self Stabilization1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
What Can Be Implemented Anonymously ? Paper by Rachid Guerraui and Eric Ruppert Presentation by Amir Anter 1.
Hagit Attiya (CS, Technion) Joint work with Rachid Guerraoui (EPFL) Eric Ruppert (York University) Partial Snapshots.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 19: Asynchronous Solvability 1.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 18: Wait-Free Simulations Beyond Registers 1.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 3 (26/01/2006) Instructor: Haifeng YU.
Atomic Snapshots. Abstract Data Types Abstract representation of data & set of methods (operations) for accessing it Implement using primitives on base.
1 © R. Guerraoui Regular register algorithms R. Guerraoui Distributed Programming Laboratory lpdwww.epfl.ch.
Common2 extended to stacks and unbound concurrency By:Yehuda Afek Eli Gafni Adam Morrison May 2007 Presentor: Dima Liahovitsky 1.
Asynchronous Exclusive Selection Bogdan Chlebus, U. Colorado Darek Kowalski, U. Liverpool.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 16: Distributed Shared Memory 1.
Distributed Algorithms (22903) Lecturer: Danny Hendler The wait-free hierarchy and the universality of consensus This presentation is based on the book.
Distributed Algorithms (22903) Lecturer: Danny Hendler The Atomic Snapshot Object The Renaming Problem This presentation is based on the book “Distributed.
Distributed Algorithms (22903) Lecturer: Danny Hendler Shared objects: linearizability, wait-freedom and simulations Most of this presentation is based.
Distributed Algorithms (22903) Lecturer: Danny Hendler Approximate agreement This presentation is based on the book “Distributed Computing” by Hagit attiya.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Distributed Algorithms (22903)
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Outline lecture Revise arrays Entering into an array
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Distributed Algorithms (22903)
Computing with anonymous processes
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Algebraic Topology and Distributed Computing part two
Byzantine-Resilient Colorless Computaton
CMSC 341 Lecture 10 B-Trees Based on slides from Dr. Katherine Gibson.
Advanced Associative Structures
Hash Table.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Distributed Algorithms (22903)
Agreement Protocols CS60002: Distributed Systems
Unit-2 Divide and Conquer
Dijkstra’s Algorithm for the Shortest Path Problem
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
(Slides were added to Keren’s original presentation. DH.)
Hash Tables Chapter 12 discusses several ways of storing information in an array, and later searching for the information. Hash tables are a common.
Rodolfo Conde Joint work with Sergio Rajsbaum Instituto de Matemáticas
Distributed Algorithms (22903)
Distributed Algorithms (22903)
Distributed Algorithms (22903)
Distributed Algorithms (22903)
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Distributed Algorithms (22903)
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Hash Tables Chapter 12 discusses several ways of storing information in an array, and later searching for the information. Hash tables are a common.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Distributed Algorithms (22903)
Deterministic Objects: Life Beyond Consensus
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Distributed Algorithms (22903)
Algorithms CSCI 235, Spring 2019 Lecture 19 Order Statistics
Chapter 24: Single-Source Shortest-Path
Computing with anonymous processes
Distributed systems Consensus
(Slides were added to Keren’s original presentation. DH.)
Presentation transcript:

Distributed Algorithms (22903) The Atomic Snapshot Object And Applications Lecturer: Danny Hendler This presentation is based on the book “Distributed Computing” by Hagit attiya & Jennifer Welch.

Atomic snapshot objects Each process has a SWMR register, which we call a segment A process may obtain an ‘atomic snapshot’ of all segments. Atomic Snapshot sequential specification Two operations are supported: Updatei(d), by pi, updates pi’s segment to value d. Scan, returns a vector V, where V is an n-element vector called a view (with a value for each segment). V[i] must return the value of the latest Updatei operation (or the initial value if there were none) Scan returns a snapshot of the segments array that existed at some point during the execution!

A trivial (and wrong) algorithm Initially segment[i]=vi Updatei(S, v) Segment[i]=v Scani(S) for i=1 to n tmp[i]=Segment[i] return < tmp[1], …, tmp[n] > Why is this algorithm incorrect?

What if segments change while being collected? Atomic snapshot simulation: key algorithmic ideas (Afek, Attiya, Dolev, Gafni, Merritt, Shavit, 1993) A scan collects all segments twice (double collect). If the two collects are identical, they are a legal view What if segments change while being collected? Then we try again and again until some segment undergoes “enough” changes (we can be sure its last update started after our scan) We then use a view embedded in that update We use timestamps to distinguish different writes of same value

A wait-free simulation of atomic snapshot Initially segment[i].ts=0, segment[i].data=vi, segment[i].view=<v0, …, vn-1> Updatei(S, d) view:=scan() Segment[i]=<segment[i].ts+1, d, view> Scani(S) for all j <> i c[j]=Segment[j] while true do for all j a[j] = Segment[j] for all j b[j] = Segment[j] if, for all j a[j]=b[j] ; Comparison includes timestamp! return <b[0].data, …, b[n-1].data> ; Direct scan else if, for some j ≠ i, b[j].ts - c[j].ts ≥ 2 return b[j].view ; Indirect scan

Linearization order A direct scan is linearized immediately after the last read of its first collect An indirect scan is linearized at the same point as the direct scan whose view it borrowed. An update is linearized when it writes to its segment.

A proof that the algorithm for atomic snapshot is wait-free and linearizable

The Renaming Problem Processes start with unique names from a large domain Processes should pick new names that are still distinct but that are from a smaller domain Motivation: Suppose original names are serial numbers (many digits), but we'd like the processes to do some kind of time slicing based on their ids

Renaming Problem Definition Termination: Eventually every nonfaulty proc pi decides on a new name yi Uniqueness: If pi and pj are distinct nonfaulty procs, then yi ≠ yj. Anonymity: Processes cannot directly use their index, only their name.

Performance of Renaming Algorithm New names should be drawn from {1,2,…,M}. We would like M to be as small as possible. Uniqueness implies M must be at least n. Due to the possibility of failures, M will actually be larger than n.

Wait-free renaming algorithm Processes communicate via snapshot object Each process iteratively stores its original name and (suggested) new name If the name suggested by p is taken, it next suggests the k’th free name, where k is its original rank

Wait-free renaming algorithm (cont’d) Shared: Snapshot S, each entry is of the form <x,s>, initially empty Local: int oldName ;this is pi’s original name int newName ;this is pi’s suggested name, initially 1 Program for process i newName := 1 ;Maybe I can get the smallest name While true do ;While haven’t fixed my new name S.updatei(<oldName,newName>) ;Announce new suggestion <x0,s0>,…,<xn-1,sn-1> := S.scan() ;take a snapshot if (newName = sj for some j ≠ i) ;ouch, there’s a clash ; select the r’th free name, where r is my rank let r be the rank of oldName in {xj ≠ empty | 0≤j≤n-1} let newName be r’th integer not in {sj ≠ empty | 0≤j ≠ i ≤n-1} else return newName

The algorithm is a correct wait-free implementation of renaming that requires at most 2n-1 names

Renaming Results Algorithm for wait-free case (f = n - 1) with M = n + f = 2n - 1. Algorithm for general f with M = n + f. Lower bound that M must be at least n + 1, for the wait-free case. Proof similar to impossibility of wait-free consensus Stronger lower bound that M must be at least n + f, if f is the number of possible failures Proof uses algebraic topology and is related to lower bound for set consensus