Figure 10.1 Skew between computer clocks in a distributed system Network Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 1
Figure 10.2 Clock synchronization using a time server m r m r Pp m t m t Time Server, server,ss Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 2
Figure 10.3 An example synchronization subnet in an NTP implementation 1 2 2 3 3 3 Note: Arrows denote synchronization control, numbers denote strata. Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 3
Figure 10.4 Messages exchanged between a pair of NTP peers Server B T i 2 T i 1 Time m m' Server A T i 3 T i Time Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 4
Figure 10.5 Events occurring at three processes p 1 a b m 1 c d m 2 Physical time p 3 e f Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 5
Figure 10.6 Lamport timestamps for the events shown in Figure 10.5. 1 2 p 1 a b m 1 3 4 c d m 2 Physical time p 3 1 e f 5 Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 6
Figure 10.7 Vector timestamps for the events shown in Figure 10.5 (1,0,0) (2,0,0) p 1 a b m 1 (2,1,0) (2,2,0) c d m 2 Physical time p 3 (0,0,1) e f (2,2,2) Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 7
Figure 10.8 Detecting global properties p 1 a. Garbage collection object reference message garbage object p1 wait-for b. Deadlock wait-for p1 c. Termination passive activate passive Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 8
Figure 10.9 Cuts e 1 0 e 1 1 e 1 2 e 1 3 p 1 m 1 m 2 e 2 0 e 2 1 e 2 2 Physical time Inconsistent cut Consistent cut Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 9
Figure 10.10 Chandy and Lamport s snapshot algorithm Marker receiving rule for process On p i s receipt of a marker message over channel c: if ( p i has not yet recorded its state) it records its process state now; records the state of c as the empty set; turns on recording of messages arriving over other incoming channels; else p i records the state of c as the set of messages it has received over c since it saved its state. end if Marker sending rule for process p i After p i has recorded its state, for each outgoing channel c: p i sends one marker message over c (before it sends any other message over c). p i Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 10
Figure 10.11 Two processes and their initial states p c 1 2 c 1 $1000 (none) $50 2000 account widgets account widgets Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 11
Figure 10.12 The execution of the processes in Figure 10.11 1. Global state S 0 2. Global state S 1 3. Global state S 2 4. Global state S 3 c 2 <$1000, 0> p 1 (empty) <$50, 2000> c 1 c 2 (empty) <$900, 0> p 1 (Order 10, $100), M <$50, 2000> c 1 c 2 (empty) <$900, 0> p 1 (Order 10, $100), M <$50, 1995> c 1 c 2 (five widgets) <$900, 5> p 1 (Order 10, $100) <$50, 1995> c 1 (empty) (M = marker message) Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 12
Figure 10.13 Reachability between states in the snapshot algorithm actual execution e 0,e 1,... S init recording begins recording ends S final S snap pre-snap: e' 0,e' 1,...e' R-1 post-snap: e' R,e' R+1,... Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 13
Figure 10.14 Vector timestamps and variable values for the execution of Figure 10.9 p 1 (1,0) (2,0) (3,0) (4,3) x 1 = 1 x 1 = 100 x 1 = 105 x 1 = 90 m 1 m 2 x 2 = 100 x 2 = 95 x 2 = 90 (2,1) (2,2) (2,3) Cut C 2 Physical time Cut C 1 Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 14
Figure 10.15 The lattice of global states for the execution of Figure 10.14 Level 0 S 00 1 S 10 2 3 S 30 S 20 S 21 S ij = global state after i events at process 1 and j events at process 2 4 5 S31 S 32 S 22 S 23 6 S 33 7 S 43 Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 15
Figure 10.16 Algorithms to evaluate possibly φ and definitely φ 1. Evaluating possibly φ for global history H of N processes L := 0; States := { s 0 1 s 0 0 (, 2,, s N )}; while ( φ( S) = False for all S States) L := L + 1; Reachable := { S : S reachable in H from some S States level( S ) = L}; States := Reachable end while output "possibly φ"; 2. Evaluating definitely φ for global history H of N processes L := 0; if (φ s 0 1 s 0 0 (, 2,, s N )) then States := {} else States := { s 0 1 s 0 0 (, 2,, s N )}; while (States {}) L := L + 1; Reachable := { S : S reachable in H from some S States level( S' ) = L}; States := { S Reachable: φ( S) = False} end while output "definitely φ"; Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 16
Figure 10.17 Evaluating definitely φ Level 0 F 1 F 2 F F = (φ(s) = False); T = (φ(s) = True) 3 4 5 F F T? Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001 17