190 likes | 200 Views
Dive into the intricacies of determining global states in distributed computing, exploring difficulties, scenarios, algorithms, and the properties of recorded states. Learn how processes and channels cooperate to achieve consistency.
E N D
Lecture 3:State, Detection Anish Arora CSE 763 Notes include material from Dr. Jeff Brumfield
Reading for this Lecture • Distributed Snapshots: Determining Global States of Distributed Computing by Chandy and Lamport http://research.microsoft.com/users/lamport/pubs/chandy.pdf • Chapter 9 in Paul Sivilotti's book
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
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
Example Single token conservation system one token is passed between processes
Example • Process states: with token or without token • Channel states: token in transit or empty • State transition diagram for a process:
Example Global state transition diagram
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
Determining a Channel's State Scenario 2: • sender records its state (with token) • sender sends token • channel state is recorded (with token) • Global state shows 2 tokens! Consistency Problems Scenario 1: • channel state is recorded (no token) • sender sends token • sender records its state (no token) • Global state shows no token!
Global State Detection Algorithm Initiating process • record own state • send one marker on each outgoing channel before sending any further messages on that channel
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
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
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
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?
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