110 likes | 227 Vues
This discussion delves into the concept of distributed snapshots in state machines, focusing on the peculiar outcomes of the Chandy-Lamport snapshot algorithm. It examines unusual situations where a state seems feasible yet was never visited during computation, raising questions about the relevance and utility of snapshots for detecting stable predicates and for checkpointing. We also explore limitations when channels aren't FIFO and how the Lai-Yang algorithm addresses these issues without markers. Ultimately, we discuss practical applications such as network topology determination, termination detection, and deadlock detection.
E N D
Another example of distributed snapshot: Communicating State Machines
Something unusual Let machine i start Chandy-lamport snapshot before it has sent M along ch1. Also, let machine j receive the marker after it sends out M’ along ch2. Observe that the snapshot state is down up M’ Doesn’t this appear strange? This state was never reached during the computation!
Understanding snapshot The observed state is a feasible state that is reachable from the initial configuration. It may not actually be visited during a specific execution. The final state of the original computation is always reachable from the observed state.
Discussions What good is a snapshot if that state has never been visited by the system? - It is relevant for the detection of stable predicates. - Useful for checkpointing.
Discussions What if the channels are not FIFO? Study how Lai-Yang algorithm works. It does not use any marker LY1. The initiator records its own state. When it needs to send a message m to another process, it sends a message (m, red). LY2. When a process receives a message (m, red), it records its state if it has not already done so, and then accepts the message m. Question 1. Why will it work? Question 1 Are there any limitations of this approach?
Questions Distributed snapshot = distributed read. Distributed reset = distributed write How difficult is distributed reset?
Global state collection Some applications - computing network topology - termination detection - deadlock detection Chandy Lamport algorithm does a partial job. Each process collects a fragment of the global state, but these pieces have to be stitched together to form a global state.
Once the pieces of a consistent global state become available, consider collecting the global state via all-to-all broadcast At the end, each process will compute a set V, where V= {s(i): 0 ≤ i ≤ N-1 } A simple exercise s(i) s(j) i j s(k) s(l) k l
Program broadcast (for process i} define V.i, W.i : set of values; initially V.i={s(i)}, W.i = andevery channel is empty do V.i ≠ W.i send (V.i \ W.i) to every outgoing channel; W.i := V.i ¬ empty (k, i) receive X from channel(k, i); V.i := V.i X od All-to-all broadcast Assume that the topology is strongly connected graph V.i W.i V.k W.k (i,k) Acts like a “pump”
Lemma. empty (i. k) W.i V.k. (Upon termination) i: V.i = W.i, and all channels are empty. So, V.i V.k. On a cyclic path, V.i = V.k must be true. Since s(i)V.i, s(i)V.k Proof V.i W.i V.k W.k (i,k)