Snapshot Algorithm - Chandy Lamport
PK E
System Model:
" A distributed system isa set of n asynchronous processes that
do not share a common memory.
"They communicate with each other by SsY passing over the
Slocucational
communication channel.
" There is no physical global in the system. tiona
Inl stitute
Snapshot Algorithm - Chandy Lamport
Global State:
"Global state of adistributed system is acollection of localstates
of the communication channele
Ono ates
PK ofthe
Edúatioystitut
l Institute
Consistent Global State:
Aglobal state is said to be consistent if
every messaB a
recorded as received is also recorded as sent.
PK
"Amessage cannot be received if it was not sent.
Snapshot Algorithm - Chandy Lamport
Snapshot:
" In a distributed system, a snapshot is a consistent recording
of the global state of the system at a particular time.
"Itcaptures the local state of each processes as well as the state
of communication channels between
Educa them.
Needs of recording snapshot: PK EducationalInstitu
" Debugging
"Fault tolerance
" Checkpointing
" Consistency
Snapshot Algorithm - Chandy Lamport
PK ED
Chandy Lamport Algorithm:
1. Initiator process Po records its state locally.
2. Marker sendingrule for process P, :
After P, has recorded its state, it sends a marker message to
çeach outgoing channels before: sending any other messages.
P
3. Marker receiving rule for process P: cational
Institute
On receiving a marker along channel C
if (P, has not yet recorded its state):
(i)Records the state of channelCas an emptyset.
(i) Starts recording messages arriving over incoming cha
Snapshot Algorithm - Chandy Lamport
else (P, has already recorded its state):
Records the state of channel C as the set of all messages
l overchannel C. nal
Institute
y Edu