The simple way for to take a snapshot of the global state doesn’t assure us that global state is consistent.

Another way to approach the problem is the Chandy-Lamport protocol.

It assumes the channels are FIFO, meaning if in channel two events and exists such that , sends a message to channel 2 that receives it in event and a message from that is being received in , then we are sure that .

The protocol stats with sending a “take-snapshot” message to one (or more) process. When a process receives a message:

  • If it’s the first message it has received, it sends a message to all the other processes.
  • If it has already received a message, it saves its local state.

The protocol takes the snapshot of the system once every process has received its message.

The protocol ends when every process has received its last message.

Both the cuts taken from the protocol are consistent.

Consistency proof

Let’s rememeber that a cut is consistent if .

C is the cut taken by the protocol, C’ is the cut when the protocol has finished

C is the cut taken by the protocol, C’ is the cut when the protocol has finished