Distributed systems: causal broadcast
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
Causal broadcast is an algorithm for implementing causal delivery. Recall that if 's send happens before 's send, then under causal delivery must be delivered before (with respect to the happens before relation). Here is the causal broadcast algorithm:
- Initialize a local clock to for each process.
- If a message from is delivered at (recall that this is different from it being received), then increment 's local clock in the position.
- If a message is to be sent from , increment its own position in its local clock, then include the local clock when sending the message.
- A message from is only delivered at if: a. The position in the message's timestamp must be one greater than the position in 's local clock. That is is, this must be the next expected messages from . b. All other positions of the message's timestamp must be less than or equal to the corresponding positions in 's local clock. That is, there must be no missing messages from other processes.
Causal ordering can also be used to find a consistent global snapshot of a system. One algorithm to do this is the Chandy-Lamport algorithm. This will be discussed in the next lecture.