Notes on Distributed Systems

unsplash-image

Course Details:

CSE138, Lecture on Youtube: https://www.youtube.com/playlist?list=PLNPUF5QyWU8O0Wd8QDh9KaM1ggsxspJ31 by Professor Lindsey Kuper, UC Santa Cruz

What & Why?

What is a distributed system?
Ways of failures:

Time and clocks

physical clockslogical clocks
time-of-day & monotonic clocksonly measure ordering of events
 which event happened before another

Lamport Diagrams

Happens-Before Relation

Causal Anomaly

Consider this lamport diagram:

Network Models

State And Events

Partial Orders

Lamport Clocks

Vector Clocks

Protocols

Message Delivery

FIFO Delivery

Causal Delivery

Totally Ordered Delivery

Delivery guarantees

Implementing FIFO delivery

Implementing Causal Delivery

Causal Broadcast Algorithm

  1. If a message sent by P1 is delivered at P2, increment P2's local clock in the P1's position

  2. If a message is sent by a process, then first increment its own position in its local clock, and include the local clock along with the message

  3. A message sent by process P1 is only delivered at P2 if:

    • VC at position P1 of incoming message is equal to VC at position P1 of P2's VC + 1 i.e P1'sVC[P1] = P2'sVC[P1] + 1. This ensures that timestamp on the message from P1 makes it the next expected message
    • and, VC at all other positions of incoming message is less than equal to VC of all other positions of P2's VC i.e P1'sVC[Pk] P2'sVC[Pk] for all k 1. This ensures that no missing messages from other processes

Here's another example:

Uses of potential causality

Ways that potential causality (->) is used in distributed systems:

Chandy-Lamport Snapshot Algorithm

Cut

Safety - Liveness property

Fault Models

Two Generals Problem