Rishi Distributed System
Rishi Distributed System
BELAGAVI-590018
Distributed System
Seminar report
On
Submitted by
2024-2025
Global States
In a distributed system, where multiple processes or nodes operate independently, a global state represents
the collective state of all these components at a specific point in time. It's a snapshot of the entire system,
capturing the state of each process and the messages in transit between them.
Consistent Global State: A state in which the system is coherent and all the nodes have a consistent
view of the system at the same time. A consistent snapshot can be used for recovery or rollback.
Inconsistent Global State: When the global state cannot be captured coherently due to the asynchrony
or concurrency issues. This is common in real-world distributed systems and may require specialized
algorithms to reconcile the differences.
Stable Global State: A state in which no further changes will occur, either due to completion of
computation or because the system is in a steady state. Detecting a stable global state is often
important in distributed algorithms like termination detection.
Chandy-Lamport Snapshot Algorithm: This is a well-known algorithm for taking a consistent global
snapshot of a distributed system. It works by having each process record its state and send a special marker
message along its outgoing channels. Upon receiving a marker, the process records the state of incoming
channels as well. The algorithm ensures that the snapshot is consistent by making sure that no messages are
lost or recorded out of order.
The algorithm proceeds through use of special marker messages, which are distinct from any other
messages the processes send and which the processes may send and receive while they proceed with
their normal execution.
The algorithm is defined through two rules, the marker receiving rule and the marker sending rule
(Figure 14.10). The marker sending rule obligates processes to send a marker after they have
recorded their state, but before they send any other messages.
The marker receiving rule obligates a process that has not recorded its state to do so. In that case, this
is the first marker that it has received. It notes which messages subsequently arrive on the other
incoming channels.
When a process that has already saved its state receives a marker (on another channel), it records the
state of that channel as the set of messages it has received on it since it saved its state.
Thus it records its state and begins to record messages arriving over all its incoming channels.
Several processes may initiate recording concurrently in this way (as long as the markers they use
can be distinguished).
We illustrate the algorithm for a system of two processes, p1 and p2 , connected by two
unidirectional channels, c1 and c2 .
The two processes trade in ‘widgets’. Process p1 sends orders for widgets over c2 to p2 , enclosing
payment at the rate of $10 per widget. Some time later, process p2 sends widgets along channel c1 to
p1.
The processes have the initial states shown in Figure 14.11. Process p2 has already received an order
for five widgets, which it will shortly dispatch to p1 .
Figure 14.12 shows an execution of the system while the state is recorded. Process p1 records its
state in the actual global state S0 , when the state of p1 is . Following the marker sending rule,
process p1 then emits a marker message over its outgoing channel c2 before it sends the next
application-level message: (Order 10, $100), over channel c2 .
The system enters actual global state S1 . Before p2 receives the marker, it emits an application
message (five widgets) over c1 in response to p1 ’s previous order, yielding a new actual global state
S2 .
Now process p1 receives p2 ’s message (five widgets), and p2 receives the marker. Following the
marker receiving rule, p2 records its state as and that of channel c2 as the empty sequence.
Following the marker sending rule, it sends a marker message over c1 . When process p1 receives p2
’s marker message, it records the state of channel c1 as the single message (five widgets) that it
received after it first recorded its state.
The final actual global state is S3 . The final recorded state is p1 : ; p2 : ; c1 : ; c2 : < >.
Note that this state differs from all the global states through which the system actually passed.
However, if a stable predicate is True in the state Ssnap then we may conclude that the predicate is
True in the state Sfinal , since by definition a stable predicate that is True of a state S is also True of
any state reachable from S. Similarly, if the predicate evaluates to False for Ssnap , then it must also
be False for Sinit .