Distributed systems: vector clocks
These are my notes for Lindsey Kupuer's spring 2020 distributed systems course.
- Lecture 3/4 - partial orders and Lamport clocks
- Lecture 5 - vector clocks
- Lecture 6 - delivery guarantees
- Lecture 7 - causal broadcast
Vector clocks are similar to Lamport clocks, but make a stronger guarantee: for events and , if and only if . Vector clocks are assigned as follows:
- For each process, initialize a (local) length- vector to all zero, where is the number of processes.
- If process has an event, increment position of process 's counter by 1.
- If process sends a message, increment position of its counter by 1 and send the counter with the message.
- If process receives a message, increment position of process 's counter by 1 and take the elementwise maximum with the received counter.
If and are vector clocks, then we define if and only if for all and .