Open In App

Chandy–Lamport’s global state recording algorithm

Each distributed system has a number of processes running on a number of different physical servers. These processes communicate with each other via communication channels using text messaging. These processes neither have a shared memory nor a common physical clock, this makes the process of determining the instantaneous global state difficult. 

A process could record it own local state at a given time but the messages that are in transit (on its way to be delivered) would not be included in the recorded state and hence the actual state of the system would be incorrect after the time in transit message is delivered.



Chandy and Lamport were the first to propose a algorithm to capture consistent global state of a distributed system. The main idea behind proposed algorithm is that if we know that all message that  have been sent by one process have been received by another then we can record the global state of the system. 

Any process in the distributed system can initiate this global state recording algorithm using a special message called MARKER. This marker traverse the distributed system across all communication channel and cause each process to record its own state. In the end, the state of entire system (Global state) is recorded. This algorithm does not interfere with normal execution of processes. 



Assumptions of the algorithm:

Algorithm:

Need of taking snapshot or recording global state of the system:

Article Tags :