0% found this document useful (0 votes)
235 views

Snapshot Exercises Withsolutions

distributing computing

Uploaded by

misbah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
235 views

Snapshot Exercises Withsolutions

distributing computing

Uploaded by

misbah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

I.

Chandy-Lamport Global Snapshots Algorithm


• Mark the entire global snapshot collected.

P0 a b

P1

P2
Marker Message
c Regular Message c
I. Chandy-Lamport Global Snapshots Algorithm
• Mark the entire global snapshot collected.

P0 a b

P1

P2
Marker Message
c Regular Message c

P0: S(a)
P1: R(a)
P2: {}
C01: {}
C02: {}
C10: {}
C12: {}
C20: {}
C21: {}
II. Chandy-Lamport Global Snapshots Algorithm
• Mark the entire global snapshot collected.

P0 a b
e
P1
c d f
P2
Marker Message
c Regular Message c
II. Chandy-Lamport Global Snapshots Algorithm
• Mark the entire global snapshot collected.

S0
C20 = <> C10 = <>
P0 a b
C21 = <c> e
P1 S1
C01 = <>
c d f
P2 S2 C02 = <> C12 = <d>

Marker Message
c Regular Message c

P0: S(a)
P1: S(d)
P2: S(c)
C01: {}
C02: {}
C10: {}
C12: {d}
C20: {}
C21: {c}
III. Mark all Lamport timestamps for application messages
on this figure for all events.
All Lamport timestamps start from zero.

P0 a b
e
P1
c d f
P2
Marker Message
c Regular Message c
III. Mark all Lamport timestamps for application messages
on this figure for all events.
All Lamport timestamps start from zero.

1 3 6
P0 a b
2 3 4 5 e
P1
1 c d 4
f5 6
2
P2
Marker Message
c Regular Message c

P0: S(a)
P1: S(d)
P2: S(c)
C01: {}
C02: {}
C10: {}
C12: {d}
C20: {}
C21: {c}
IV. Mark all vector timestamps for application messages
on this figure for all events.
All vector timestamps start from zeroes.

P0 a b
e
P1
c d f
P2
Marker Message
c Regular Message c
IV. Mark all vector timestamps for application messages
on this figure for all events.
All vector timestamps start from zeroes.

(1,0,0) (2,0,2) (3,2,4)


P0 a b
e
P1 (1,1,0) (1,2,0) (1,3,1) (1,4,1)
c d f
P2 (0,0,1) (0,0,2) (1,2,3) (1,2,4) (1,4,5)
Marker Message
c Regular Message c
V. Chandy-Lamport Global Snapshots Algorithm
•P0 initiates a snapshots run. Something is wrong with the figure. What?
V. Chandy-Lamport Global Snapshots Algorithm
•P0 initiates a snapshots run. Something is wrong with the figure. What?

Answer: Message d and the marker from P0 to P2 violate FIFO. As a result, the cut
created by this snapshot is inconsistent (contains d’s receipt event, but not d’s send
event).
VI. Chandy-Lamport Global Snapshots Algorithm
•P0 initiates a snapshots run. Something is wrong with the figure. What?
VI. Chandy-Lamport Global Snapshots Algorithm
•P0 initiates a snapshots run. Something is wrong with the figure. What?

Answer: When P2 receives a marker (from P0), it must send out its markers
immediately. In this timeline, it processes message d first then sends out its markers. As
a result, it is unclear if d’s receipt event belongs to the cut or not.
VII. Chandy-Lamport Global Snapshots Algorithm
•P0 initiates a snapshots run. Some of the markers in transit are shown. List ALL
the possible snapshots that might be collected. You must assume FIFO channels.
VII. Chandy-Lamport Global Snapshots Algorithm
•P0 initiates a snapshots run. Some of the markers in transit are shown. List ALL
the possible snapshots that might be collected. You must assume FIFO channels.

Answer: Messages a, b, and d are all sent after the cut at their respective sender
process, so by causality their receipt events cannot be in the cut. Message c is sent
before the cut at P2, so it’s send event is a part of the cut. However, c is received at P0
after the cut, thus c is the only message that is captured in the snapshot. There is only
one possible snapshot.

You might also like