Upload
eliezer-lyne
View
227
Download
8
Tags:
Embed Size (px)
Citation preview
From Coulouris, Dollimore, Kindberg and Blair
Distributed Systems: Concepts and Design
Edition 5, © Addison-Wesley 2012
Slides for Chapter 14: Time and Global States
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.1Skew between computer clocks in a distributed system
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.2Clock synchronization using a time server
mr
m tp Time server,S
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.3An example synchronization subnet in an NTP implementation
1
2
3
2
3 3
Note: Arrows denote synchronization control, numbers denote strata.
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.4Messages exchanged between a pair of NTP peers
Ti
Ti-1Ti-2
Ti- 3
Server B
Server A
Time
m m'
Time
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.5Events occurring at three processes
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.6Lamport timestamps for the events shown in Figure 14.5
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.7Vector timestamps for the events shown in Figure 14.5
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.8Detecting global properties
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.9Cuts
m1 m2
p1
p2Physical
time
e10
Consistent cutInconsistent cut
e 11
e 12
e 13
e 20
e 21
e 22
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.10Chandy and Lamport’s ‘snapshot’ algorithm
Marker receiving rule for process pi
On pi’s receipt of a marker message over channel c:if (pi has not yet recorded its state) itrecords its process state now;records the state of c as the empty set;turns on recording of messages arriving over other incoming channels;else pi 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 pi
After pi has recorded its state, for each outgoing channel c: pi sends one marker message over c (before it sends any other message over c).
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.11Two processes and their initial states
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.12The execution of the processes in Figure 14.11
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.13Reachability between states in the snapshot algorithm
Sinit Sfinal
Ssnap
actual execution e0,e1,...
recording recording begins ends
pre-snap: e'0,e '1,...e'R-1 post-snap: e 'R,e 'R+1,...
'
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.14Vector timestamps and variable values for the execution of Figure 14.9
m1 m2
p1
p2Physical
time
Cut C1
(1,0) (2,0) (4,3)
(2,1) (2,2) (2,3)
(3,0)
x1= 1 x1= 100 x1= 105
x2= 100 x2= 95 x2= 90
x1= 90
Cut C 2
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.15The lattice of global states for the execution of Figure 14.14
Sij = global state after i events at process 1 and j events at process 2
S00
S10
S20
S21S30
S31
S32
S22
S23
S33
S43
Level 0
1
2
3
4
5
6
7
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.16Algorithms to evaluate possibly φ and definitely φ
Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012
Figure 14.17Evaluating definitely φ