- 2073 Shrawan · 4+6 marks
State recording, debugging, distributed cuts
Short answer
State recording is used for deadlock detection, termination detection, checkpointing, and garbage collection. Distributed debugging checks safety and liveness predicates. In the figure, C1 is consistent, C2 is inconsistent (message crosses from right to left), C3 is consistent with in-transit messages, and C4 is strongly consistent.
What are the principle applications of state recording and distributed debugging? Determine the types of distributed CUT in the following figure. [Figure: three process time-lines P0, P1, P2 drawn horizontally, with diagonal message arrows passing between the processes (P0 to P1, P1 to P2, P2 to P0 and P1 to P0 etc.) and four dashed cut lines C1, C2, C3 and C4 drawn across the three time-lines from left to right; exact message endpoints are not legible in the scan.]
Applications of global state recording
- Garbage collection: find objects with no references anywhere in the system, including references in messages in transit.
- Deadlock detection: build a wait-for graph from a consistent state to see a cycle.
- Termination detection: check that all processes are passive and no messages are in transit.
- Checkpointing and recovery: save a consistent state to restart after a failure.
- Detecting stable properties such as lost tokens, and measuring system load.
Applications of distributed debugging
- Check predicates (global conditions) during an execution, for example "lock is held by two processes" (safety) or "the system is deadlocked".
- Detect that a safety bug (bad state, such as violation of mutual exclusion) occurred, or that a liveness condition never occurs.
- Replay and trace executions, find causal relations of events, and locate faults.
- Monitor consistency of replicated data and correct ordering of messages. Debugging uses consistent cuts and vector clocks to evaluate predicates on states which may have happened.
Types of distributed cuts
A cut is a set of events, a prefix of each process's history; its frontier is the last event of each process in the cut.
- Consistent cut: for every event in the cut, all events that happened before it are also in the cut. Equivalently, no message crosses the cut line from the future to the past (no message received inside the cut whose send is outside).
- Inconsistent cut: contains a receive event whose send event lies outside the cut (message travels backward across the cut line, from right to left in the figure).
- A consistent cut may have messages in transit (sent inside, received outside), which form the channel state.
- Strongly consistent cut: consistent and with no messages in transit at all.
Classifying C1 to C4
The message endpoints are not legible, so the usual method is applied under the following assumption: a cut that is a vertical-like line leaning forward in time from top to bottom in the same direction as messages is consistent; one that is crossed by a message arrow going from its right side to its left side is inconsistent.
| Cut | Check | Type |
|---|---|---|
| C1 | no message arrow enters the cut from the right | consistent |
| C2 | some message crosses from right to left (receive in cut, send outside) | inconsistent |
| C3 | messages only cross left to right | consistent, with messages in transit |
| C4 | no message crosses at all | strongly consistent |
For each cut, trace every arrow that crosses it: send before the line and receive after the line is allowed; the reverse makes the cut inconsistent. Consistent cuts correspond to valid global states that the system could have passed through.
Related questions
- Short note: Distributed debugging · Distributed System, chapter 5
- Short note: Distributed cut · Distributed System, chapter 5
- Threads, checkpoint, distributed commit · Distributed System, chapter 3
- Applications, advantages of DS · Distributed System, chapter 1
- Homogeneous vs heterogeneous applications · Distributed System, chapter 4
- Short note: Process resilience · Distributed System, chapter 9 · asked 4×
- Liang-Barsky: P1(-5,3), P2(15,9) · Computer Graphics, chapter 3
- Get data from P0, send to P1 (asm and C) · Embedded System, chapter 9
- Process to determine wire size · Basic Electrical and Electronics Engineering, chapter 4
- Short note: Total station principle, data recording · Surveying II, chapter 9