same problem different approach
play

Same problem, different approach Monitor process does not query - PowerPoint PPT Presentation

Same problem, different approach Monitor process does not query explicitly Instead, it passively collects information and uses it to build an observation. (reactive architectures, Harel and Pnueli [1985]) An observation is an ordering of event


  1. Same problem, different approach Monitor process does not query explicitly Instead, it passively collects information and uses it to build an observation. (reactive architectures, Harel and Pnueli [1985]) An observation is an ordering of event of the distributed computation based on the order in which the receiver is notified of the events. 75

  2. Observations: a few observations An observation puts no constraint on the order in which the monitor receives notifications p 0 e 1 1 p 1 76

  3. Observations: a few observations An observation puts no constraint on the order in which the monitor receives notifications p 0 e 2 e 1 1 1 p 1 77

  4. Observations: a few observations An observation puts no constraint on the order in which the monitor receives notifications p 0 e 2 e 1 1 1 p 1 78

  5. Observations: a few observations An observation puts no constraint on the order in which the monitor receives notifications p 0 e 2 e 1 1 1 p 1 To obtain a run, messages must be delivered to the monitor in FIFO order 79

  6. Observations: a few observations An observation puts no constraint on the order in which the monitor receives notifications p 0 e 2 e 1 1 1 p 1 To obtain a run, messages must be delivered to the monitor in FIFO order What about consistent runs? 80

  7. Causal delivery FIFO delivery guarantees: send i ( m ) → send i ( m � ) ⇒ deliver j ( m ) → deliver j ( m � ) 81

  8. Causal delivery FIFO delivery guarantees: send i ( m ) → send i ( m � ) ⇒ deliver j ( m ) → deliver j ( m � ) Causal delivery generalizes FIFO: send i ( m ) → send k ( m � ) ⇒ deliver j ( m ) → deliver j ( m � ) 82

  9. Causal delivery FIFO delivery guarantees: send i ( m ) → send i ( m � ) ⇒ deliver j ( m ) → deliver j ( m � ) Causal delivery generalizes FIFO: send i ( m ) → send k ( m � ) ⇒ deliver j ( m ) → deliver j ( m � ) p 1 send event m receive event deliver event p 2 p 3 83

  10. Causal delivery FIFO delivery guarantees: send i ( m ) → send i ( m � ) ⇒ deliver j ( m ) → deliver j ( m � ) Causal delivery generalizes FIFO: send i ( m ) → send k ( m � ) ⇒ deliver j ( m ) → deliver j ( m � ) p 1 send event m receive event deliver event p 2 p 3 84

  11. Causal delivery FIFO delivery guarantees: send i ( m ) → send i ( m � ) ⇒ deliver j ( m ) → deliver j ( m � ) Causal delivery generalizes FIFO: send i ( m ) → send k ( m � ) ⇒ deliver j ( m ) → deliver j ( m � ) p 1 send event m receive event deliver event p 2 m � p 3 85

  12. Causal delivery FIFO delivery guarantees: send i ( m ) → send i ( m � ) ⇒ deliver j ( m ) → deliver j ( m � ) Causal delivery generalizes FIFO: send i ( m ) → send k ( m � ) ⇒ deliver j ( m ) → deliver j ( m � ) p 1 send event m receive event deliver event p 2 m � p 3 1 86

  13. Causal delivery FIFO delivery guarantees: send i ( m ) → send i ( m � ) ⇒ deliver j ( m ) → deliver j ( m � ) Causal delivery generalizes FIFO: send i ( m ) → send k ( m � ) ⇒ deliver j ( m ) → deliver j ( m � ) p 1 send event m receive event deliver event p 2 m � p 3 1 2 87

  14. Causal Delivery in Synchronous Systems We use the upper bound on ∆ message delivery time 88

  15. Causal Delivery in Synchronous Systems We use the upper bound on ∆ message delivery time DR1: At time , delivers all messages t p 0 it received with timestamp up to t − ∆ in increasing timestamp order 89

  16. Causal Delivery with Lamport Clocks � DR1.1: � Deliver all received messages in � increasing (logical clock) timestamp order. 90

  17. Causal Delivery with Lamport Clocks � DR1.1: � Deliver all received messages in � increasing (logical clock) timestamp order. 1 p 0 91

  18. Causal Delivery with Lamport Clocks � DR1.1: � Deliver all received messages in � increasing (logical clock) timestamp order. 1 4 Should deliver? p 0 p 0 92

  19. Causal Delivery with Lamport Clocks � DR1.1: � Deliver all received messages in � increasing (logical clock) timestamp order. 1 4 Should deliver? p 0 p 0 Problem: Lamport Clocks don’ t provide gap detection Given two events and and their clock e � e values and — where LC ( e � ) LC ( e ) LC ( e ) < LC ( e � ) determine whether some event exists s.t. e �� LC ( e ) < LC ( e �� ) < LC ( e � ) 93

  20. Stability DR2: � Deliver all received stable messages in increasing (logical clock) timestamp order. A message received by is stable at if p p p m will never receive a future message s.t. m � TS ( m � ) < TS ( m ) 94

  21. Implementing Stability Real-time clocks wait for time units ∆ 95

  22. Implementing Stability Real-time clocks wait for time units ∆ Lamport clocks wait on each channel for s.t. TS ( m ) > LC ( e ) m Design better clocks! 96

  23. Clocks and STRONG Clocks Lamport clocks implement the clock condition: e → e � ⇒ LC ( e ) < LC ( e � ) We want new clocks that implement the strong clock condition: e → e � ≡ SC ( e ) < SC ( e � ) 97

  24. Causal Histories The causal history of an event in is the set ( H, → ) e θ ( e ) = { e � ∈ H | e � → e } ∪ { e } 98

  25. Causal Histories The causal history of an event in is the set ( H, → ) e θ ( e ) = { e � ∈ H | e � → e } ∪ { e } e 1 e 2 e 3 e 4 e 5 1 1 1 1 1 p 1 p 2 e 1 e 2 e 3 2 2 2 p 3 e 1 e 2 e 3 e 4 3 3 3 3 99

  26. Causal Histories The causal history of an event in is the set ( H, → ) e θ ( e ) = { e � ∈ H | e � → e } ∪ { e } e 1 e 2 e 3 e 4 e 5 1 1 1 1 1 p 1 p 2 e 1 e 2 e 3 2 2 2 p 3 e 1 e 2 e 3 e 4 3 3 3 3 e → e � ≡ θ ( e ) ⊂ θ ( e � ) 100

  27. How to build θ ( e ) Each process : p i initializes θ := ∅ θ : if is an internal or send event, then e k i θ ( e k i ):= { e k i } ∪ θ ( e k − 1 ) i if is a receive event for message , then e k m i i } ∪ θ ( e k − 1 θ ( e k i ):= { e k ) ∪ θ ( send ( m )) i 101

  28. Pruning causal histories Prune segments of history that are known to all processes (Peterson, Bucholz and Schlichting) Use a more clever way to encode θ ( e ) 102

  29. Vector Clocks Consider , the projection of on θ i ( e ) θ ( e ) p i h i θ i ( e ) = h k i is a prefix of : – it can be θ i ( e ) i encoded using k i can be θ ( e ) = θ 1 ( e ) ∪ θ 2 ( e ) ∪ . . . ∪ θ n ( e ) encoded using k 1 , k 2 , . . . , k n Represent using an -vector such that θ V C n V C ( e )[ i ] = k ⇔ θ i ( e ) = h k i i 103

  30. Update rules e i p i V C ( e i )[ i ] := V C [ i ] + 1 Message is m timestamped with m TS ( m ) = V C ( send ( m )) e i p i V C ( e i ) := max ( V C, TS ( m )) V C ( e i )[ i ] := V C [ i ] + 1 104

  31. Example [1,0,0] [2,1,0] [5,1,2] [3,1,2] [4,1,2] p 1 [1,2,3] p 2 [0,1,0] [4,3,3] p 3 [1,0,1] [1,0,2] [1,0,3] [5,1,4] 105

  32. Operational interpretation [1,0,0] [2,1,0] [5,1,2] [3,1,2] [4,1,2] p 1 [1,2,3] p 2 [0,1,0] [4,3,3] p 3 [1,0,1] [1,0,2] [1,0,3] [5,1,4] = V C ( e i )[ i ] = V C ( e i )[ j ] 106

  33. Operational interpretation [1,0,0] [2,1,0] [5,1,2] [3,1,2] [4,1,2] p 1 [1,2,3] p 2 [0,1,0] [4,3,3] p 3 [1,0,1] [1,0,2] [1,0,3] [5,1,4] = no. of events executed by up to and including V C ( e i )[ i ] p i e i = V C ( e i )[ j ] 107

  34. Operational interpretation [1,0,0] [2,1,0] [5,1,2] [3,1,2] [4,1,2] p 1 [1,2,3] p 2 [0,1,0] [4,3,3] p 3 [1,0,1] [1,0,2] [1,0,3] [5,1,4] = no. of events executed by up to and including V C ( e i )[ i ] p i e i = no. of events executed by that happen before of V C ( e i )[ j ] p j p i e i 108

  35. VC properties: event ordering Given two vectors and , less than is defined as: V � V V < V � ≡ ( V � = V � ) ∧ ( ∀ k : 1 ≤ k ≤ n : V [ k ] ≤ V � [ k ]) Strong Clock Condition: e → e � ≡ V C ( e ) ≤ V C ( e � ) Simple Strong Clock Condition: Given of and of , where i � = j p i e j p j e i e i → e j ≡ V C ( e i )[ i ] ≤ V C ( e j )[ i ] Concurrency Given of and of , where i � = j p i e j p j e i e i � e j ≡ ( V C ( e i )[ i ] > V C ( e j )[ i ]) ∧ ( V C ( e j )[ j ] > V C ( e i )[ j ]) 109

  36. VC properties: consistency Pairwise inconsistency Events of and of are pairwise ( i � = j ) e i p i e j p j inconsistent (i.e. can’t be on the frontier of the same consistent cut) if and only if ( VC ( e i )[ i ] < VC ( e j )[ i ]) ∨ ( VC ( e j )[ j ] < VC ( e i )[ j ]) Consistent Cut A cut defined by is consistent if and ( c 1 , . . . , c n ) only if i )[ i ] ≥ VC ( e c j ∀ i, j : 1 ≤ i ≤ n, 1 ≤ j ≤ n : ( VC ( e c i j )[ i ]) 110

  37. VC properties: weak gap detection Weak gap detection Given of and of , if VC ( e i )[ k ] < VC ( e j )[ k ] p i e i e j p j for some , then there exists s.t k � = j e k ¬ ( e k → e i ) ∧ ( e k → e j ) [2,0,1] p i [2,2,2] p j p k [0,0,2] 111

  38. VC properties: weak gap detection Weak gap detection Given of and of , if VC ( e i )[ k ] < VC ( e j )[ k ] p i e i e j p j for some , then there exists s.t k � = j e k ¬ ( e k → e i ) ∧ ( e k → e j ) [1,0,1] [2,0,1] p i [2,2,2] p j [2,1,1] p k [0,0,1] [0,0,2] 112

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend