0% found this document useful (0 votes)
12 views6 pages

Rishi Distributed System

The seminar report discusses global states in distributed systems, defining a global state as a snapshot of the entire system at a specific time. It highlights the need for global states in various applications such as garbage collection, deadlock detection, and fault tolerance, and outlines types of global states including consistent, inconsistent, and stable states. The report also details the Chandy-Lamport Snapshot Algorithm for capturing consistent global states, emphasizing its assumptions and operational rules.

Uploaded by

rishikesh9098
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views6 pages

Rishi Distributed System

The seminar report discusses global states in distributed systems, defining a global state as a snapshot of the entire system at a specific time. It highlights the need for global states in various applications such as garbage collection, deadlock detection, and fault tolerance, and outlines types of global states including consistent, inconsistent, and stable states. The report also details the Chandy-Lamport Snapshot Algorithm for capturing consistent global states, emphasizing its assumptions and operational rules.

Uploaded by

rishikesh9098
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

BELAGAVI-590018

Distributed System

Seminar report

On

“Global States in distributed system”

Submitted by

Rishikesh Ranjan – 1ST22IS047

Under the Guidance of


Mrs. Sowmyashree
Assistant Professor, Dept. Of ISE

DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING


SAMBHRAM INSTITUTE OF TECHNOLOGY

M.S.Palya, Vidyaranyapura, Bangalore-560097

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.

Need of Global States :


 Distributed garbage collection: An object is considered to be garbage if there are no longer any
references to it anywhere in the distributed system. The memory taken up by that object can be
reclaimed once it is known to be garbage. To check that an object is garbage, we must verify that
there are no references to it anywhere in the system.
 Distributed deadlock detection: A distributed deadlock occurs when each of a collection of processes
waits for another process to send it a message, and where there is a cycle in the graph of this ‘waits-
for’ relationship.
 Distributed debugging: Distributed systems are complex to debug [Bonnaire et al. 1995], and care
needs to be taken in establishing what occurred during the execution.
 Distributed termination detection: The problem here is how to detect that a distributed algorithm has
terminated. Detecting termination is a problem that sounds deceptively easy to solve: it seems at first
only necessary to test whether each process has halted.
 Fault Tolerance: In the case of failures, the global state helps in recovering or reconstructing the
system’s state and making decisions about the consistency of data (e.g., in distributed databases).
Types of Global States :

 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.

Techniques to Capture Global States :

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 assumes that:


• Neither channels nor processes fail – communication is reliable so that every message sent is eventually
received intact, exactly once.
• Channels are unidirectional and provide FIFO-ordered message delivery.
• The graph of processes and channels is strongly connected (there is a path between any two processes). •
Any process may initiate a global snapshot at any time.
• The processes may continue their execution and send and receive normal messages while the snapshot
takes place.
 For each process pi , let the incoming channels be those at pi over which other processes send it
messages; similarly, the outgoing channels of pi are those on which it sends messages to other
processes.

 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.

Termination of the snapshot algorithm :


 We assume that a process that has received a marker message records its state within a finite time
and sends marker messages over each outgoing channel within a finite time (even when it no longer
needs to send application messages over these channels).
 If there is a path of communication channels and processes from a process pi to a process pj (j not
equal to i), then it is clear on these assumptions that pj will record its state a finite time after pi
recorded its state. Since we are assuming the graph of processes and channels to be strongly
connected, it follows.

Stability and the reachability of the observed state


 The reachability property of the snapshot algorithm is useful for detecting stable predicates. In
general, any non-stable predicate we establish as being True in the state Ssnap may or may not have
been True in the actual execution whose global state we recorded.

 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 .

Stability and the reachability of the observed state :


 The reachability property of the snapshot algorithm is useful for detecting stable predicates. In
general, any non-stable predicate we establish as being True in the state Ssnap may or may not have
been True in the actual execution whose global state we recorded.
 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. S.
 Similarly, if the predicate evaluates to False for Ssnap , then it must also be False for Sinit .

You might also like