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

same problem different approach
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 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

slide-2
SLIDE 2

Observations: a few observations

An observation puts no constraint on the order in which the monitor receives notifications

p1

e1

1

p0

76

slide-3
SLIDE 3

Observations: a few observations

An observation puts no constraint on the order in which the monitor receives notifications

p1

e1

1

e2

1

p0

77

slide-4
SLIDE 4

Observations: a few observations

An observation puts no constraint on the order in which the monitor receives notifications

p1

e1

1

e2

1

p0

78

slide-5
SLIDE 5

Observations: a few observations

An observation puts no constraint on the order in which the monitor receives notifications To obtain a run, messages must be delivered to the monitor in FIFO order

p1

e1

1

e2

1

p0

79

slide-6
SLIDE 6

Observations: a few observations

An observation puts no constraint on the order in which the monitor receives notifications To obtain a run, messages must be delivered to the monitor in FIFO order What about consistent runs?

p1

e1

1

e2

1

p0

80

slide-7
SLIDE 7

Causal delivery

FIFO delivery guarantees:

sendi(m) → sendi(m) ⇒ deliverj(m) → deliverj(m)

81

slide-8
SLIDE 8

Causal delivery

FIFO delivery guarantees: Causal delivery generalizes FIFO:

sendi(m) → sendi(m) ⇒ deliverj(m) → deliverj(m) sendi(m) → sendk(m) ⇒ deliverj(m) → deliverj(m)

82

slide-9
SLIDE 9

Causal delivery

FIFO delivery guarantees: Causal delivery generalizes FIFO:

sendi(m) → sendi(m) ⇒ deliverj(m) → deliverj(m) sendi(m) → sendk(m) ⇒ deliverj(m) → deliverj(m) p1 p2 p3

m

send event receive event deliver event 83

slide-10
SLIDE 10

Causal delivery

FIFO delivery guarantees: Causal delivery generalizes FIFO:

sendi(m) → sendi(m) ⇒ deliverj(m) → deliverj(m) sendi(m) → sendk(m) ⇒ deliverj(m) → deliverj(m) p1 p2 p3

m

send event receive event deliver event 84

slide-11
SLIDE 11

Causal delivery

FIFO delivery guarantees: Causal delivery generalizes FIFO:

sendi(m) → sendi(m) ⇒ deliverj(m) → deliverj(m) sendi(m) → sendk(m) ⇒ deliverj(m) → deliverj(m) p1 p2 p3

m

send event receive event deliver event

m

85

slide-12
SLIDE 12

Causal delivery

FIFO delivery guarantees: Causal delivery generalizes FIFO:

sendi(m) → sendi(m) ⇒ deliverj(m) → deliverj(m) sendi(m) → sendk(m) ⇒ deliverj(m) → deliverj(m) p1 p2 p3

m

send event receive event deliver event

m

1 86

slide-13
SLIDE 13

Causal delivery

FIFO delivery guarantees: Causal delivery generalizes FIFO:

sendi(m) → sendi(m) ⇒ deliverj(m) → deliverj(m) sendi(m) → sendk(m) ⇒ deliverj(m) → deliverj(m) p1 p2 p3

m

send event receive event deliver event

m

1 2 87

slide-14
SLIDE 14

Causal Delivery in Synchronous Systems

We use the upper bound on message delivery time ∆

88

slide-15
SLIDE 15

Causal Delivery in Synchronous Systems

We use the upper bound on message delivery time DR1: At time , delivers all messages it received with timestamp up to in increasing timestamp order ∆ t p0 t−∆

89

slide-16
SLIDE 16

Causal Delivery with Lamport Clocks

DR1.1: Deliver all received messages in increasing (logical clock) timestamp order.

90

slide-17
SLIDE 17

Causal Delivery with Lamport Clocks

DR1.1: Deliver all received messages in increasing (logical clock) timestamp order.

1

p0

91

slide-18
SLIDE 18

Causal Delivery with Lamport Clocks

DR1.1: Deliver all received messages in increasing (logical clock) timestamp order.

1

p0

4

Should deliver? p0

92

slide-19
SLIDE 19

Causal Delivery with Lamport Clocks

DR1.1: Deliver all received messages in increasing (logical clock) timestamp order. Problem: Lamport Clocks don’ t provide gap detection

1

p0

4

Should deliver? p0

Given two events and and their clock values and — where determine whether some event exists s.t. e e LC(e) LC(e) LC(e) < LC(e) LC(e) < LC(e) < LC(e) e

93

slide-20
SLIDE 20

Stability

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

94

slide-21
SLIDE 21

Implementing Stability

Real-time clocks wait for time units ∆

95

slide-22
SLIDE 22

Implementing Stability

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

96

slide-23
SLIDE 23

Clocks and STRONG Clocks

Lamport clocks implement the clock condition: We want new clocks that implement the strong clock condition: e → e ⇒ LC(e) < LC(e) e → e ≡ SC(e) < SC(e)

97

slide-24
SLIDE 24

Causal Histories

The causal history of an event in is the set e (H, →)

θ(e) = {e ∈ H | e → e} ∪ {e}

98

slide-25
SLIDE 25

Causal Histories

The causal history of an event in is the set e (H, →) p2 p1 p3

e1

1

e2

1

e3

1

e4

1

e5

1

e1

2

e2

2

e3

2

e3

3

e1

3

e2

3

e4

3

θ(e) = {e ∈ H | e → e} ∪ {e}

99

slide-26
SLIDE 26

Causal Histories

The causal history of an event in is the set e (H, →) p2 p1 p3

e1

1

e2

1

e3

1

e4

1

e5

1

e1

2

e2

2

e3

2

e3

3

e1

3

e2

3

e4

3

e → e ≡ θ(e) ⊂ θ(e) θ(e) = {e ∈ H | e → e} ∪ {e}

100

slide-27
SLIDE 27

How to build

Each process : initializes if is an internal or send event, then if is a receive event for message , then

θ(e)

θ : θ := ∅ ek

i

pi ek

i

m θ(ek

i ):={ek i } ∪ θ(ek−1 i

) ∪ θ(send(m)) θ(ek

i ):={ek i } ∪ θ(ek−1 i

)

101

slide-28
SLIDE 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

slide-29
SLIDE 29

Vector Clocks

Consider , the projection of on is a prefix of : – it can be encoded using can be encoded using θi(e) θ(e) pi θi(e) hi θi(e) = hki

i

ki θ(e) = θ1(e) ∪ θ2(e) ∪ . . . ∪ θn(e) k1, k2, . . . , kn Represent using an -vector such that θ n V C V C(e)[i] = k ⇔ θi(e) = hki

i

103

slide-30
SLIDE 30

Update rules

pi pi

ei m ei

Message is timestamped with

m

TS(m) = V C(send(m))

V C(ei)[i] := V C[i] + 1 V C(ei) := max(V C, TS(m)) V C(ei)[i] := V C[i] + 1

104

slide-31
SLIDE 31

Example

[1,0,0] [0,1,0] [2,1,0] [1,0,1] [1,0,2] [1,0,3] [3,1,2] [1,2,3] [4,1,2] [5,1,2] [4,3,3] [5,1,4]

p1 p2 p3

105

slide-32
SLIDE 32

Operational interpretation

= =

[1,0,0] [0,1,0] [2,1,0] [1,0,1] [1,0,2] [1,0,3] [3,1,2] [1,2,3] [4,1,2] [5,1,2] [4,3,3] [5,1,4]

p1 p2 p3

V C(ei)[i] V C(ei)[j]

106

slide-33
SLIDE 33

Operational interpretation

= no. of events executed by up to and including =

[1,0,0] [0,1,0] [2,1,0] [1,0,1] [1,0,2] [1,0,3] [3,1,2] [1,2,3] [4,1,2] [5,1,2] [4,3,3] [5,1,4]

p1 p2 p3

pi V C(ei)[i] V C(ei)[j] ei

107

slide-34
SLIDE 34

Operational interpretation

= no. of events executed by up to and including = no. of events executed by that happen before of

[1,0,0] [0,1,0] [2,1,0] [1,0,1] [1,0,2] [1,0,3] [3,1,2] [1,2,3] [4,1,2] [5,1,2] [4,3,3] [5,1,4]

p1 p2 p3

pi V C(ei)[i] V C(ei)[j] ei pj pi ei

108

slide-35
SLIDE 35

VC properties: event ordering

Given two vectors and , less than is defined as: Strong Clock Condition: Simple Strong Clock Condition: Given of and of , where Concurrency Given of and of , where

V V V < V ≡ (V = V ) ∧ (∀k : 1 ≤ k ≤ n : V [k] ≤ V [k]) ei → ej ≡ V C(ei)[i] ≤ V C(ej)[i] e → e ≡ V C(e) ≤ V C(e) ei ej ≡ (V C(ei)[i] > V C(ej)[i]) ∧ (V C(ej)[j] > V C(ei)[j])

ei pi pj ej i = j ei pi pj ej i = j

109

slide-36
SLIDE 36

VC properties: consistency

Pairwise inconsistency Events of and of are pairwise inconsistent (i.e. can’t be on the frontier of the same consistent cut) if and only if Consistent Cut A cut defined by is consistent if and

  • nly if

∀i, j : 1 ≤ i ≤ n, 1 ≤ j ≤ n : (VC(eci

i )[i] ≥ VC(ecj j )[i])

(VC(ei)[i] < VC(ej)[i]) ∨ (VC(ej)[j] < VC(ei)[j]) (i = j) (c1, . . . , cn) ei pi pj ej

110

slide-37
SLIDE 37

VC properties: weak gap detection

Weak gap detection Given of and of , if for some , then there exists s.t VC(ei)[k] < VC(ej)[k] k = j ek ¬(ek → ei) ∧ (ek → ej)

[2,2,2] [2,0,1]

pi pj pk

[0,0,2]

ei pi pj ej

111

slide-38
SLIDE 38

VC properties: weak gap detection

Weak gap detection Given of and of , if for some , then there exists s.t VC(ei)[k] < VC(ej)[k] k = j ek ¬(ek → ei) ∧ (ek → ej)

[2,2,2] [2,0,1]

pi pj pk

[0,0,2]

ei pi pj ej

[2,1,1] [0,0,1] [1,0,1]

112

slide-39
SLIDE 39

VC properties: strong gap detection

Weak gap detection Given of and of , if for some , then there exists s.t Strong gap detection Given of and of , if then there exists s.t. VC(ei)[i] < VC(ej)[i] ei pi pj ej e

i

¬(ek → ei) ∧ (ek → ej) (ei → e

i) ∧ (e i → ej)

VC(ei)[k] < VC(ej)[k] k = j ek ei pi pj ej

113

slide-40
SLIDE 40

VCs for Causal Delivery

Each process increments the local component

  • f its only for events that are notified to

the monitor Each message notifying event is timestamped with The monitor keeps all notification messages in a set M e VC VC(e)

114