Distributed systems: delivery guarantees
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
A channel is the connection between two processes. A message can be queued when it is received on a channel and later delivered to a process.
An example is FIFO delivery, where a message is queued until all messages that were sent before it (with respect to the sender's local clock) have been received. A FIFO anomaly is when message is sent before , but is received first. This is also a causal anomaly. FIFO delivery can be implemented by tagging messages with a sender ID and a sequence number that is locally incremented on each send. If we receive a message with sender ID and sequence number , we queue it until is delivered. This algorithm assumes reliable delivery: it fails if messages can be lost. FIFO delivery can also be implemented using acknowledgements. If sends a message to , it waits for an acknowledgement from before sending its next message. In practice, many protocols use TCP to implement FIFO delivery.
Another example of a delivery guarantee is causal delivery: if 's send happens before (see lectures 3/4 for definition) 's send, then 's delivery happens before 's delivery. It can be implemented by attaching vector clocks to each message sent; this will be discussed in the next lecture.
In totally-ordered delivery, if a process delivers before , then all processes deliver before . This ensures messages appear in the same order on all processes. A FIFO anomaly isn't a total order violation. This gives us a hierarchy of delivery guarantees: