Time and coordination (5) Flashcards
What relationship does events that are not related in the “happened- before” relation have?
They are concurrent.
Why do we use logical clocks?
They are a way for processes to be able to agree about the order events have happened in.
Where in the architecture are logical clocks located?
Between app- layer and the network. i.e. inside the middleware.
What are the two rules for logical clocks?
LC1:
Each process must increment its logical clock with 1 before an event on the process is applied.
LC2:
When a process sends a message it piggybacks its own logical clock on the message. The receiver sets its own logical clock to the biggest of the two and applies LC1 before it timestamps the recv event.
What info does vector clocks give us that logical clocks can not?
Logical clocks capture dependencies as a consequence of message exchange but not causality.
Vector clocks can catch causality as well.
What are the 4 rules for vector clocks?
Each process p maintans a vector clock Vp of size N.
A timestamp for event a at process p: Vp(a)
VC1:
Vp[j] is initially 0 for all nodes j.
VC2:
p increments Vp[p] with 1 before each event timestamp.
VC3:
if p sends a message m, it piggybacks Vp on m.
VC4:
If (m, ts) is received by q, q computes Vq[j] to max(Vq[j], ts[j] for all j. Then it applies VC2.
How is the (local) history of a process modelled?
A history for a process p is a sequence events and corresponding state at p.
How is the global history of a system defined?
A collection of all local histories, on from each process.
What is a cut of a global state?
A union of prefixes from some processes’ local histories. i.e. that we cut all events in the global history from a certain point to reason about it.
What is a consistent cut?
If an event e is included in the cut, and an event f -> e, then f must be in the cut as well for it to be consistent.
What is a linearisation?
A linearisation is an arbitrary extension of a partial ordering of events in global history. (basically that you also give an ordering to events in the global history that are concurrent)
What does it mean that state S’ is reachable from state S?
State S’ is reachable from state S if there exists a linearization that starts in S and ends in S’.
What is stable property?
If something is true in S, it is true in any state reachable from S.
What is safety property?
If something is true in any state reachable from S0(initial state) it has the safety property.
What is liveness property?
In any linearisation there is a state reachable from S0 where it is true.