Snapshot of local states on n processes at the exact same time for
We don’t have a magical camera that can record the state at the exact same time across n processes, given that they sync by message passing.
We have to weaken the goal: Snapshot of local states on n processes that could have happened sometime in the past.
Global snapshot: A set of events S such that
Consistent Global snapshot: A global snapshot (i.e. incld process order) such that
Consistent global snapshot encapsulates the idea of “could have happened in the past”: a possible current state of the program. (outcome of a send cannot happen before the send.)
Consider a totally ordered sequence of events e1,e2,….
Theorem: For any positive integer m, ∃ consistent global snapshot S such that
{ei∈S for i≤mei∉S for i>mProof intuition:
Let em be in S where S is a consistent global snapshot.
Then for all ei→em we have ei∈S. Since ei→em, we have i<m.
Let ej∉S for all j>m. As we do not have any ej→em since ej>em, we can do this.
For all k<m such that ek<em, we can include them in the set S and it will still be a consistent global snapshot, as for any el→ek, we have l<k<m so el∈S.
Assumptions:
Right before process 1 sends message M to process 2, a special message is sent from process 1 to process 2 when process 1 wants to tell process 2 to take a snapshot.
Upon receiving the special message, process 2 needs to take a snapshot before it can receive M.
hence any process will receive n−1 special messages.
There is an initiator global snapshot, which sends out special messages to all of the other processes in the system.
Every process is either in white state (no local snapshot taken) or red state (taken).
Upon receiving a special message for the first time (turn from white to red) it will send out n−1 special messages to all the rest of the processes too.
Now we are able to capture the processes’ state, but not yet the messages on the fly!
The only state in which this exists is when process 1 snapshot after send and process 2 snapshot before receive.
To achieve this the special message from i to j has a dual purpose of being the endpoint of which i to j’s messages must be marked (if j is already red).