Distributed Snapshot.

Slides:



Advertisements
Similar presentations
Distributed Snapshots: Determining Global States of Distributed Systems - K. Mani Chandy and Leslie Lamport.
Advertisements

Global States.
Distributed Snapshots: Determining Global States of Distributed Systems Joshua Eberhardt Research Paper: Kanianthra Mani Chandy and Leslie Lamport.
Global States in a Distributed System By John Kor and Yvonne Cheng.
Distributed Computing 5. Snapshot Shmuel Zaks ©
Uncoordinated Checkpointing The Global State Recording Algorithm.
Uncoordinated Checkpointing The Global State Recording Algorithm Cristian Solano.
Time and Global States Part 3 ECEN5053 Software Engineering of Distributed Systems University of Colorado, Boulder.
CS542 Topics in Distributed Systems Diganta Goswami.
Distributed Computing 5. Snapshot Shmuel Zaks ©
Global State Collection. Global state collection Some applications - computing network topology - termination detection - deadlock detection Chandy-Lamport.
Distributed Snapshot (continued)
Causality & Global States. P1 P2 P Physical Time 4 6 Include(obj1 ) obj1.method() P2 has obj1 Causality violation occurs when order.
CMPT 431 Dr. Alexandra Fedorova Lecture VIII: Time And Global Clocks.
Distributed Systems Fall 2009 Logical time, global states, and debugging.
Ordering and Consistent Cuts Presented by Chi H. Ho.
EEC-681/781 Distributed Computing Systems Lecture 11 Wenbing Zhao Cleveland State University.
Cloud Computing Concepts
1 Distributed Systems CS 425 / CSE 424 / ECE 428 Global Snapshots Reading: Sections 11.5 (4 th ed), 14.5 (5 th ed)  2010, I. Gupta, K. Nahrtstedt, S.
Distributed Computing 5. Snapshot Shmuel Zaks ©
UBI529 Distributed Algorithms
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.
Distributed Snapshot. Think about these -- How many messages are in transit on the internet? --What is the global state of a distributed system of N processes?
Distributed Systems Fall 2010 Logical time, global states, and debugging.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Global States Steve Ko Computer Sciences and Engineering University at Buffalo.
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.
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.
Networks and Distributed Snapshot Sukumar Ghosh Department of Computer Science University of Iowa.
Global State Collection
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
CSE 486/586 CSE 486/586 Distributed Systems Global States Steve Ko Computer Sciences and Engineering University at Buffalo.
Hwajung Lee. Some applications - computing network topology - termination detection - deadlock detection Chandy Lamport algorithm does a partial job.
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.
Efficient Algorithms for Distributed Snapshots and Global Virtual Time Approximation Author: Friedermann Mattern Presented By: Shruthi Koundinya.
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.
Global state and snapshot
Consistent cut A cut is a set of events.
Global State Recording
Global state and snapshot
Lecture 3: State, Detection
CSE 486/586 Distributed Systems Global States
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
Distributed Snapshot.
湖南大学-信息科学与工程学院-计算机与科学系
Global state collection
Slides for Chapter 14: Time and Global States
Time And Global Clocks CMPT 431.
Global State Collection
Distributed Snapshot Distributed Systems.
Chapter 5 (through section 5.4)
Uncoordinated Checkpointing
Slides for Chapter 11: Time and Global State
Slides for Chapter 14: Time and Global States
ITEC452 Distributed Computing Lecture 8 Distributed Snapshot
Distributed Snapshot.
Chap 5 Distributed Coordination
CSE 486/586 Distributed Systems Global States
Jenhui Chen Office number:
Distributed algorithms
CIS825 Lecture 5 1.
Consistent cut If this is not true, then the cut is inconsistent
Slides for Chapter 14: Time and Global States
Chandy-Lamport Example
Presentation transcript:

Distributed Snapshot

Think about these on the internet? -- 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 these?

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 counted “properly,” then one may think the total $ in circulation to be one million.

Importance of snapshots Major uses in - deadlock detection - termination detection - rollback recovery - global predicate computation

Consistent cut If this is not true, then the cut C is inconsistent A cut is a set of events. If a cut C is consistent then (a ∈ C) ⋀ (b ≺ a) ⇒ b ∈ C If this is not true, then the cut C is inconsistent time

Consistent snapshot The set of states immediately following the events (actions) in a consistent cut forms a consistent snapshot of a distributed system. A snapshot that is of practical interest is the most recent one. Let C1 and C2 be two consistent cuts and C1 ⊂ C2. Then C2 is more recent than C1. Analyze why certain cuts in the one-dollar bank are inconsistent.

Consistent snapshot How to record a consistent snapshot? Note that 1. The recording must be non-invasive. 2. Recording must be done on-the-fly. You cannot stop the system.

Chandy-Lamport Algorithm Works on a (1) strongly connected graph (2) each channel is FIFO. An initiator initiates the algorithm by sending out a marker ( )

White and red processes Initially every process is white. When a process receives a marker, it turns red if it has not already done so. Every action by a process, and every message sent by a process gets the color of that process.

Two steps Step 1. In one atomic action, the initiator (a) Turns red (b) Records its own state (c) sends a marker along all outgoing channels Step 2. Every other process, upon receiving a marker for the first time (and before doing anything else) (a) Turns red (b) Records its own state (c) sends markers along all outgoing channels The algorithm terminates when (1) every process turns red, and (2) Every process has received a marker through each incoming channel.

Why does it work? Lemma 1. No red message is received in a white action.

Why does it work? SSS All white All red Easy conceptualization of the snapshot state Theorem. The global state recorded by Chandy-Lamport algorithm is equivalent to the ideal snapshot state SSS. Hint. A pair of actions (a, b) can be scheduled in any order, if there is no causal order between them, so (a; b) is equivalent to (b; a)

Why does it work? Let an observer observe the following actions: w[i] w[k] r[k] w[j] r[i] w[l] r[j] r[l] …  w[i] w[k] w[j] r[k] r[i] w[l] r[j] r[l] … [Lemma 1] w[i] w[k] w[j] r[k] w[l] r[i] r[j] r[l] … [Lemma 1] w[i] w[k] w[j] w[l] r[k] r[i] r[j] r[l] … [done!] Recorded state

Example 1: Count the tokens Let us verify that Chandy-Lamport snapshot algorithm correctly counts the tokens circulating in the system 2 token C token no token A no token token no token B A no token token no token C 1 3 B Are these consistent cuts? How to account for the channel states? Use sent and received variables for each process.

Example 2: Communicating State Machines

Something unusual Let machine i start Chandy-Lamport snapshot before it has sent M along ch1. Also, let machine j receive the marker after it sends out M’ along ch2. Observe that the snapshot state is down ∅ up M’ Doesn’t this appear strange? This state was never reached during the computation!

Understanding snapshot

Understanding snapshot The observed state is a feasible state that is reachable from the initial configuration. It may not actually be visited during a specific execution. The final state of the original computation is always reachable from the observed state.

Discussions What good is a snapshot if that state has never been visited by the system? - It is relevant for the detection of stable predicates. - Useful for checkpointing.

Discussions What if the channels are not FIFO? Study how Lai-Yang algorithm works. It does not use any marker LY1. The initiator records its own state. When it needs to send a message m to another process, it sends a message (m, red). LY2. When a process receives a message (m, red), it records its state if it has not already done so, and then accepts the message m. Question 1. Why will it work? Question 1 Are there any limitations of this approach?

Food for thought Distributed snapshot = distributed read. Distributed reset = distributed write How difficult is distributed reset?

Distributed debugging (Marzullo and Neiger, 1991) e, VC(e) observer Distributed system

Distributed debugging

Distributed debugging Possibly ϕ: At least one consistent global state S is reachable from the initial global state, such that φ(S) = true. Definitely ϕ: All computations pass through some consistent global state S such that φ(S) = true. Never ϕ: No computation passes through some consistent global state S such that φ(S) = true. Definitely ϕ ⇒Possibly ϕ

Examples ϕ = x+y =12 (true at S21) Possibly ϕ ϕ = x+y > 15 (true at S32) Definitely ϕ ϕ = x=y=5 (true at S40 and S22) Never ϕ *Neither S40 and S22 is a consistent state*

Global State Collection

Global state collection Some applications - computing network topology - termination detection - deadlock detection Chandy-Lamport algorithm does a partial job. Each process generates a fragment of the global state, but these pieces have to be “stitched together” to form a global state.

A simple exercise s(i) s(j) i j s(k) s(l) k l At the end, each process Once the pieces of a consistent global state become available, consider collecting the global state via all-to-all broadcast At the end, each process will compute a set V, where V= {s(i): 0 ≤ i ≤ N-1 } s(i) s(j) i j s(k) s(l) k l

All-to-all broadcast Assume that the topology is a strongly connected graph V.i W.i (i,k) V.k W.k (j,i) V.j W.j Acts like a “pump”