Consistent%20cut - PowerPoint PPT Presentation

About This Presentation
Title:

Consistent%20cut

Description:

Consistent cut (a consistent cut C) (b happened before a) b C ... Analyze why certain cuts in the one-dollar bank are ... Are these consistent cuts? ... – PowerPoint PPT presentation

Number of Views:98
Avg rating:3.0/5.0
Slides: 18
Provided by: Sukuma7
Category:
Tags: 20cut | consistent | cut

less

Transcript and Presenter's Notes

Title: Consistent%20cut


1
Consistent cut
A cut is a set of events.
  • (a ? consistent cut C) ? (b happened before
    a) ? b ? C
  • If this is not true, then the cut is inconsistent

b
g
c
a
d
P1
e
m
f
P2
P3
k
h
i
j
Cut 1
Cut 2
(Not consistent)
(Consistent)
2
Consistent snapshot
  • The set of states immediately following 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.

3
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.

4
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 ( )

5
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.

6
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.

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

8
Why does it work?
All white
All red
SSS
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)

9
Why does it work?
Let an observer observe the following
actions wi wk rk wj ri wl rj rl
? wi wk wj rk ri wl rj rl
Lemma 1 ? wi wk wj rk wl ri rj
rl Lemma 1 ? wi wk wj wl rk ri
rj rl done!
Recorded state
10
Example 1. Count the tokens
  • Let us verify that Chandy-Lamport snapshot
    algorithm correctly counts
  • the tokens circulating in the system

token
C
token
no token
A
token
no token
no token
B
A
token
no token
no token
C
B
Are these consistent cuts?
How to account for the channel states? Use sent
and received variables for each process.
11
Another example of distributed snapshot
Communicating State Machines
12
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
  • Doesnt this appear strange? This state was
    never reached during the computation!

13
Understanding snapshot
14
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.
15
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.

16
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?

17
Questions
  • Distributed snapshot distributed read.
  • Distributed reset distributed write
  • How difficult is distributed reset?
Write a Comment
User Comments (0)
About PowerShow.com