Professional Documents
Culture Documents
• No global clock
• No global memory
• Communication delay finite but unpredictable
• Process execution and message transfer are asynchronous
– A process may execute an action spontaneously
– A process sending a message does not wait for the delivery of the message to
be complete
Global state of Distributed
Computation
• Represented by states of the processes and the
communication channels.
• For a message m, let send (m) and rec (m) denote its send and receive events.
– non-FIFO : A channel acts like a set in which the sender process adds
messages and the receiver process removes messages from it in a random
order.
– Example
Global State
• All messages that cross the cut from the PAST to the FUTURE are in transit in
the corresponding consistent global state.
• A cut is inconsistent if a message crosses the cut from the FUTURE to the PAST.
• Example:
Cuts in a distributed environment
Past & Future cones
Past & Future cones
Global state and snapshot
• Global state recordings must be consistent.
• Possible if the snapshots are taken at the same time in all processors.
• Infeasible due to lack of common clock.
• Even in presence of Common clock: Inconsistency will prevail due to delays in
read
Global state and snapshot
• In a consistent snapshot:
– All the recorded local states of processes are concurrent.
– The recorded local state of no process casually affects the recorded local state of any other process.
Issues in recording Global state
• I1: How to distinguish between the messages to be recorded in the snapshot
(either in channel state or a process state) from those not to be recorded.
• I2: How to determine the instant when a process takes its snapshot.
• Solutions:
• I1: Any message that is sent by a process before recording its snapshot, must
be recorded in the global snapshot (from C1). Any message that is sent by
a process after recording its snapshot, must not be recorded in the global
snapshot (from C2).
• I2: A process pj must record its snapshot before processing a message mij
that was sent by process pi after recording its snapshot (from C2).
Snapshot algorithms for FIFO channels
• The Chandy-Lamport algorithm:
– It uses a control message, called a marker.
– After a site has recorded its snapshot, it sends a marker along all of its outgoing
channels before sending out any more messages.
– Addresses Issue-1: Since channels are FIFO, a marker separates the messages in
the channel into those to be included in the snapshot from those not to be
recorded in the snapshot.
– Addresses Issue-2 : Markers in a FIFO system act as delimiters for the messages in
the channels so that the channel state recorded by the process at the receiving end
of the channel satisfies the condition C2.
– Since all messages that follow a marker on channel Cij have been sent by process pi
after pi has taken its snapshot, process pj must record its snapshot no later than
when it receives a marker on channel Cij . In general, a process
Snapshot algorithms for FIFO channels
• The Chandy-Lamport algorithm:
–
Snapshot algorithms for FIFO channels
• The Chandy-Lamport algorithm:
• Marker Sending Rule:
– A process initiates snapshot collection by executing the marker sending
rule.
– It records its local state and sends a marker on each outgoing channel.
• When a process pj receives message mij that precedes the marker on channel
Cij,:
– if process pj has not taken its snapshot yet, then it includes mij in its recorded
snapshot.
– Otherwise, it records mij in the state of the channel Cij.
– Thus, condition C1 is satisfied.
Snapshot algorithms for FIFO channels
• The Chandy-Lamport algorithm: Proving Correctness
– The recorded global state actually never occurred in the execution (It may happen)
Snapshot algorithms for FIFO channels
• The Chandy-Lamport algorithm: Proving Correctness
– The recorded global state actually never occurred in the execution (It may happen).
– Rubber-band criterion
Snapshot algorithms for non- FIFO channels
• A marker cannot be used to delineate messages into those to be
recorded in the global state from those not to be recorded in the global
state.
• In a non-FIFO system:
– Either some degree of inhibition
– Or piggybacking of control information on computation messages is used
• Ensures that no message sent by a process after recording its local snapshot is
processed by the destination process before the destination records its local snapshot
• “marker” is piggybacked on computation messages using a coloring scheme.
Snapshot algorithms for non- FIFO channels
Snapshot algorithms for non- FIFO channels
• Condition C1 holds :
– A white message mij is included in the snapshot of process pj if pj receives
mij before taking its snapshot. Otherwise, mij is included in the state of
channel Cij.
• Condition C2 holds :
– A red message is not included in the snapshot of the recipient process and
a channel state is the difference of two sets of white messages.
– All messages sent after a local snapshot recording are tagged by a tuple
< init_id, MKNO >,
• where init_id is the initiator’s identifier
• MKNO is the sequence number of the algorithm’s most recent invocation by initiator
init_id;
– To insure liveness, markers with tags similar to the above tags are explicitly
sent only on all outgoing channels on which no messages might be sent.
– The tuple < init_id MKNO > is a generalization of the red/white colors used
in Lai–Yang to accommodate repeated invocations of the algorithm and
multiple initiators.
Snapshot algorithms for non- FIFO channels
• Li et al’s Algorithm: Process
– Local state recording is done similar to Lai Yang algorithm.
Snapshot algorithms for non- FIFO channels
• Li et al’s Algorithm: Process
– Channel states are recorded as:
Snapshot algorithms for non- FIFO channels
• Li et al’s Algorithm: Process
– In this case, the algorithm uses the snapshot with the higher sequence
number to also create the snapshot for the lower sequence number.
– The local storage and size of tags on computation messages are of size O(n),
where n is the number of initiators
Snapshot algorithms for casually ordered
channels
• The causal message delivery property CO provides a built-in message
synchronization to control and computation messages.