Vector Clocks Collin J. Fidge, 1988. Timestamps in Message-Passing - - PowerPoint PPT Presentation

vector clocks
SMART_READER_LITE
LIVE PREVIEW

Vector Clocks Collin J. Fidge, 1988. Timestamps in Message-Passing - - PowerPoint PPT Presentation

Vector Clocks Collin J. Fidge, 1988. Timestamps in Message-Passing Systems That Preserve the Partial Order Order of events without global clock What happens when? event message time process A total order of events Lamport clocks 5 4 4


slide-1
SLIDE 1

Vector Clocks

Collin J. Fidge, 1988. Timestamps in Message-Passing Systems That Preserve the Partial Order

slide-2
SLIDE 2

Order of events without global clock

What happens when?

time event message process

slide-3
SLIDE 3

A total order of events

Lamport clocks

1 2 3 4 1 2 3 4 1 2 3 5 same timestamp: any (consistent) order

slide-4
SLIDE 4

A total order of events

Lamport clocks

slide-5
SLIDE 5

A total order of events

Lamport clocks

Too little information: Shows only one possible interleaving of events.

slide-6
SLIDE 6

A partial order of events

The ”happens before” relation

minimal relation

same process message transitivity

slide-7
SLIDE 7

A partial order of events

The ”happens before” relation

slide-8
SLIDE 8

A partial order of events

Vector clocks

A timestamp of a vector clock is a vector of integer clocks – one clock per process.

  • How does vector clocks work?
  • Can vector clocks represent the ”happens

before” relation?

slide-9
SLIDE 9

Vector clocks

Rules

[, , . . . , ]

slide-10
SLIDE 10

Vector clocks

Rule 4

transit time

  • ut of order
  • [] =
  • ([], [] + )

= ([], [])

slide-11
SLIDE 11

Vector clocks

Example

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

slide-12
SLIDE 12

Vector clocks

A relation on events

→ → ⇐ ⇒ [] < []

slide-13
SLIDE 13

Vector clocks

Example (again)

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

→ ⇐ ⇒ [] < []

minimal relation

same process message transitivity

slide-14
SLIDE 14

Vector clocks

The ”happens before” relation

slide-15
SLIDE 15

Vector clocks

The ”happens before” relation

→ [] < []

slide-16
SLIDE 16

Vector clocks

The ”happens before” relation

→ [] < [] −

  • [] =

(−

[], [] + )

= (−

[], [])

  • [] < (−

[], [] + )

slide-17
SLIDE 17

Vector clocks

The ”happens before” relation

[] < [] = [] [] = [] [] [] < [] []

slide-18
SLIDE 18

Vector clocks

The ”happens before” relation

  • → ⇐

⇒ [] < [] []

slide-19
SLIDE 19

Vector clocks

Conclusion

Vector clocks can describe the ”happens before” relation!

slide-20
SLIDE 20