Optimal Termination Detection for Rings Murat Demirbas OSU.

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

Distributed Snapshots: Non-blocking checkpoint coordination protocol Next: Uncoordinated Chkpnt.
Distributed Snapshots: Determining Global States of Distributed Systems - K. Mani Chandy and Leslie Lamport.
Distributed Snapshots: Determining Global States of Distributed Systems Joshua Eberhardt Research Paper: Kanianthra Mani Chandy and Leslie Lamport.
Scalable Algorithms for Global Snapshots in Distributed Systems
Lecture 8: Asynchronous Network Algorithms
SES Algorithm SES: Schiper-Eggli-Sandoz Algorithm. No need for broadcast messages. Each process maintains a vector V_P of size N - 1, N the number of processes.
Uncoordinated Checkpointing The Global State Recording Algorithm.
Token-Dased DMX Algorithms n LeLann’s token ring n Suzuki-Kasami’s broadcast n Raymond’s tree.
Leader Election Let G = (V,E) define the network topology. Each process i has a variable L(i) that defines the leader.  i,j  V  i,j are non-faulty.
CS 484. Discrete Optimization Problems A discrete optimization problem can be expressed as (S, f) S is the set of all feasible solutions f is the cost.
Distributed Computing
Discussion #33 Adjacency Matrices. Topics Adjacency matrix for a directed graph Reachability Algorithmic Complexity and Correctness –Big Oh –Proofs of.
CS542 Topics in Distributed Systems Diganta Goswami.
OSU CIS Lazy Snapshots Nigamanth Sridhar and Paul A.G. Sivilotti Computer and Information Science The Ohio State University
Termination Detection. Goal Study the development of a protocol for termination detection with the help of invariants.
Termination Detection Part 1. Goal Study the development of a protocol for termination detection with the help of invariants.
Distributed Snapshot (continued)
S NAPSHOT A LGORITHM. W HAT IS A S NAPSHOT - INTUITION Given a system of processors and communication channels between them, we want each processor to.
Ordering and Consistent Cuts Presented By Biswanath Panda.
CPSC 668Set 3: Leader Election in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CPSC 668Set 12: Causality1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
Termination Detection Presented by: Yonni Edelist.
Leader Election in Rings
Chapter 11 Detecting Termination and Deadlocks. Motivation – Diffusing computation Started by a special process, the environment environment sends messages.
Ordering and Consistent Cuts Presented by Chi H. Ho.
Backtracking Reading Material: Chapter 13, Sections 1, 2, 4, and 5.
EEC-681/781 Distributed Computing Systems Lecture 11 Wenbing Zhao Cleveland State University.
Chapter 10 Global Properties. Unstable Predicate Detection A predicate is stable if, once it becomes true it remains true Snapshot algorithm is not useful.
CIS 720 Distributed algorithms. “Paint on the forehead” problem Each of you can see other’s forehead but not your own. I announce “some of you have paint.
Chapter 9 Global Snapshot. Global state  A set of local states that are concurrent with each other Concurrent states: no two states have a happened before.
Diffusing Computation. Using Spanning Tree Construction for Solving Leader Election Root is the leader In the presence of faults, –There may be multiple.
Termination Detection
“Virtual Time and Global States of Distributed Systems”
1 Leader Election in Rings. 2 A Ring Network Sense of direction left right.
Distributed Snapshot. One-dollar bank Let a $1 coin circulate in a network of a million banks. How can someone count the total $ in circulation? If not.
D u k e S y s t e m s Asynchronous Replicated State Machines (Causal Multicast and All That) Jeff Chase Duke University.
Tree Constructions Distributed Algorithms for Multi-Agent Networks Instructor: K. Sinan YILDIRIM.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 3: Leader Election in Rings 1.
Hwajung Lee. -- How many messages are in transit on the internet? --What is the global state of a distributed system of N processes? How do we compute.
Token-passing Algorithms Suzuki-Kasami algorithm The Main idea Completely connected network of processes There is one token in the network. The holder.
Distributed Systems Lecture 6 Global states and snapshots 1.
Chapter 10 Time and Global States
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Global state and snapshot
Consistent cut A cut is a set of events.
Global State Recording
Lecture 3: State, Detection
Global state and snapshot
Lecture 3: State, Detection
Theoretical Foundations
Distributed Snapshots & Termination detection
Lecture 9: Asynchronous Network Algorithms
ITEC452 Distributed Computing Lecture 9 Global State Collection
Distributed Snapshot.
Global State Recording
EECS 498 Introduction to Distributed Systems Fall 2017
Parallel and Distributed Algorithms
Distributed Snapshot.
Global state collection
Outline Distributed Mutual Exclusion Introduction Performance measures
Global State Collection
Distributed Snapshot Distributed Systems.
ITEC452 Distributed Computing Lecture 8 Distributed Snapshot
Distributed Snapshot.
Distributed algorithms
CIS825 Lecture 5 1.
Consistent cut If this is not true, then the cut is inconsistent
Chandy-Lamport Example
Distributed Snapshot.
Presentation transcript:

Optimal Termination Detection for Rings Murat Demirbas OSU

Termination Detection in D.S. n Message passing, Asynchronous execution n A process is either active or passive n Active processes: –send and receive messages, –can become passive spontaneously n Passive processes: –can only receive messages, –can become active only by receiving a message.

Termination detection problem n The system is terminated iff –all processes are passive –no messages in transit n The problem is to detect termination as and when the system terminated.

Related work n Chandy & Lamport snapshot alg. –O(N 2 ) time n Dijkstra & Safra token-based alg. –O(N) time, 2N -- 3N n Chandy alg. –2N integers per process, and message –2N 2 integers at the detector –Sivilotti improved the space complexity

Our algorithm n Based on Dijkstra&Safra alg. n Detection in 0 -- N time n each process maintains 1 int. + N bits n token stores N int. + N bits

Outline n Dijkstra & Safra alg n Optimal alg –Enhancement 1 –Enhancement 2 n Proof

Dijkstra & Safra algorithm n c.j = #mesgs sent - #mesgs received n The initiator obtains a snapshot –sends a token to the ring –gathers the sums of c.j’s n If the snapshot is consistent and no mesg in transit, termination is detected.

Dijkstra & Safra alg (cont.) n Snapshot is inconsistent if the receipt of m is recorded but send of m is not. n A process is blackened upon receiving a mesg n A black node blackens the token N 1 2 3

N c.N color.N c.1 color.1 c.2 color.2 c.3 color.3 q color

An optimal algorithm for Termination Detection on Rings n First enhancement (Enumeration bits) n Second enhancement (Multiple initiators) n Optimal algorithm = 1st & 2nd enh. combined

1st enhancement (enumeration bits) n Dijkstra & Safra blackens every process that receives a message. n However, a message reception violates the snapshot iff the receive of the message is included in the snapshot whereas the send is not.

1st enhancement (enumeration bits) n The messages that violate the consistency are those sent by a process in the visited region to another process in the unvisited region. n A process sending a mesg piggybacks its enumeration bit + its process id. n j upon receiving “m” blackens itself iff: –enum.j  enum.m –j > sender_id.m

An enumeration bit is sufficient m+

1st enhancement: N -- 2N m+

2nd Enhancement (Multiple initiators) n D&S alg has a fixed initiator: N n A vector [q1,q2,…,qN] maintains the sum, q, w.r.t. multiple initiators. n N -- 2N time to detect termination

[0,0,0,0,0] [q1,0,0,0,0] [B,0,B,B,B] [B,q2,0,B,B] [B,q2,q3,0,B] [B,q2,q3,q4,0] [0,q2,q3,q4,q5] 1

The Optimal Algorithm n 2nd enh. blackens  j::q.j and requires 2N. n 0--N if we do not blacken any q at 2, and q2, q3 at [q1,q2,q3,q4] m2 m1

The Optimal Algorithm(cont.) n We merge 1st & 2nd enh. –enum.j, enum.m, sender_id.m (1st enh.) –[q1,q2,…,qN], tok_color.[1…N] (2nd enh.) –color.j.k n color.j.k: j’s color w.r.t. initiator k n propagate and retransmit actions are merged into one action

The Optimal Algorithm(cont.) n j receives m from l; –enum.j  enum.m and j > sender_id.m –m violates the consistency of the snapshot  k::j  k  N  1  k  l –  k:j  k  N  1  k  l: color.j.k := black

Proof n W detects X: –W  X –X leads-to W n Proof: –X: termination predicate –W: witness predicate –I: invariant –(I  W)  X –(I  X) leads-to W

Proof (cont) n X= ( (  j:: idle.j)  (#mesg_sent - #mesg_rcvd =0) ) n W= (  j::  (idle.j)  (color.j.j=white)  (c.j+q.j=0)  (tok_color.j=white) ) n I= ( (  j::c.j) = #mesg_sent - #mesg_rcvd (I 1 )  (  i:: Q.i  R.i  S.i  T.i) ) n Q.i= ( (  j:j  VSTD.i: idle.j)  q.i= (  j:j  VSTD.i:c.j) ) n R.i= ( q.i+(  j:j  VSTD.i:c.j) > 0 ) n S.i= (  j: j  VSTD.i : color.j.i=black ) n T.i= (tok_color.i=black )

Proof: (I  W)  X n Token is at j n W   (2)idle.j  (3)color.j.j=white  (4)c.j+q.j=0  (5)tok_color.j=white n (1  3)   S.j n (1  4)   R.j n 5   T.j n (I   S.j   R.j   T.j)  Q.j n (1  2  Q.j  4  I 1 )  X

Proof: (I  X) leads-toW in 0--N n (I  X)  (  j:: idle.j)  (  j::c.j) = 0 n The only enabled action is Propagate Token n Let then q.j=0, color.j.j=white, tok_color.j=white n Claim: (  k:: color.k.j = white) n Then; tok_color.j=white is stable. n When again, (c.j+q.j = (  j::c.j) = 0 ) n Therefore, within 1 cycle of token W is satisfied. n 0--N

Proof: (  k:: color.k.j = white) n Assume (  k:: color.k.j = black). 3 cases to consider: –k<j : color.k.j = black before token visits k leads-to color.k.j = white color.k.j cannot be blackened by 1  i  k, since enum.i=enum.k color.k.j cannot be blackened by k  i. –k=j : color.j.j=white –k>j : sender_id  j then color.k.j is not blackened sender_id > j then color.k.j is not blackened, since enum.sender_id =enum.k

Conclusion n An optimal termination detection algorithm on rings 0--N

New Results T.D. in Trees & Chandy’s model: n 2h--3h detection in trees n h detection in trees n Efficient T.D. in Chandy’s model: –1--2 rounds to detect termination –requires just 1 integer + 1 bit in each process including DET. –Chandy: 2N integers in each process, 2N 2 integers in DET.