Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 3: State, Detection

Similar presentations


Presentation on theme: "Lecture 3: State, Detection"— Presentation transcript:

1 Lecture 3: State, Detection
Anish Arora CSE 763 Notes include material from Dr. Jeff Brumfield 1

2 Reading for this Lecture
Distributed Snapshots: Determining Global States of Distributed Computing by Chandy and Lamport Chapter 9 in Paul Sivilotti's book

3 Statement of Problem The global state of a distributed system consists of the states of all processes and communication channels in the system Problem: Determine the global state of a distributed system during a computation

4 Statement of Problem Difficulties
A process can record only its own state and the sequence of messages it sends and receives Without a common clock, processes cannot record their states at precisely the same time We cannot freeze or alter the underlying computation

5 one token is passed between processes
Example Single token conservation system one token is passed between processes

6 Example Process states: with token or without token
Channel states: token in transit or empty State transition diagram for a process:

7 Example Global state transition diagram

8 Determining a Channel's State
The state of a channel is the sequence of messages sent along the channel excluding those received Unlike a process, a channel can't record its own state The two processes connected by the channel must cooperate to determine the channel's state For a global state to be consistent, the recorded states must satisfy the following rule: The recorded state of the channel must be the sequence of messages sent before the sender's state is recorded, excluding the sequence of messages received before the receiver's state is recorded

9 Determining a Channel's State
Consistency Problems Scenario 1: channel state is recorded (no token) sender sends token sender records its state (no token) Global state shows no token! Scenario 2: sender records its state (with token) sender sends token channel state is recorded (with token) Global state shows 2 tokens!

10 Global State Detection Algorithm
Initiating process record own state send one marker on each outgoing channel before sending any further messages on that channel

11 Global State Detection Algorithm
Upon receiving a marker on channel c if process has not recorded its state then record own state record state of channel c as empty send one marker on each outgoing channel before sending any further messages on that channel else record state of c as the sequence of messages received along c after own state was recorded and before marker was received on channel c

12 Example Process P Process Q Process P: Process Q: LOOP LOOP
send  to Q send  to P receive  from Q receive  from P END END

13 Example State of a process: "send mode" or "receive mode“
State of channel: messages in transit (if any) Initial state: both processes in send mode and both channels empty

14 Example

15 Example

16 Example

17 Example

18 Example Recorded State
Process P Process Q Note: The recorded global state is not identical to any of the global states that actually occurred Does this mean that the state detection algorithm is of no value?

19 Properties of the Recorded State
Theorem The recorded state is reachable from the state in which the algorithm was initiated. The state in which the algorithm terminated is reachable from the recorded state


Download ppt "Lecture 3: State, Detection"

Similar presentations


Ads by Google