🤔 Introduction

Global Snapshot is the

  1. P = individual state of each process in a dis sys
  2. and C = the state of each communication channel between these processes

Note: communication channels are uni-directional and FIFO-ordered

Challenge is to capture this state at the same time across all machines

image.png

Algorithm requirements


🔁 Chandy-Lamport Algorithm

initiator Pi records state of self 

for j in range(N):
	if i != j:
		send Marker to Pj 
		# start recording incoming messages on N-1 channels 
		
# handle receiving markers at Pi from Pk 
if first_time:
	Pi records state of self 
	marks channel Cik as empty 
	for j in range(N):
		if i != j:
			Pi sends marker message on outgoing channel Cij
			# start recording incoming messages on all channels except Cik
else:
	mark state of channel Cik as already arrived

Terminated once

How we got this snapshot?

  1. P1 initiator, sets local state S1 , sends marks and records channels C21, C31
  2. First marker received at P3 from P1, sets local state S3
    1. mark C13 as empty
    2. start recording C23 (record on non-receiving process channel)
  3. Duplicate marker at P1 from P3
    1. duplicate marker does nothing
  4. First marker received at P2 from P3 → sets local state S2
    1. start recording on C12 (record on non-receiving process channel)
  5. Duplicate received at P2 from P1
    1. duplicate marker does nothing
  6. Duplicate received at P1 from P2
    1. set channel C21 to incoming messages (only G->D in this case)
  7. Another duplicate at P3
  8. Done because all states recorded, all channels recorded

L13.FA24-33.jpg


✂️ Cuts

Use cuts to evaluate causal correctness of Chandy-Lamport algorithm. Proven that all runs of this algorithm create a consistent cut (lecture 13, page 42).