CoursesDistributed Reliability

Coordination and Leases

Why a lock across machines is a lease, the fencing token that makes a stale holder harmless, how a leader is elected and what it may assume, and how far a clock can be trusted.

Lessons
6
Exercises
35
Minutes
39

Start A Lock Across Machines Is a Lease

  1. 1

    A Lock Across Machines Is a Lease

    After this lesson you can say why a distributed lock must expire, what goes wrong when the holder pauses past its expiry, and why the expiry alone does not make the lock safe.

    DebugFill blankMultiple choiceTrace
    5 exercises
    6 min
  2. 2

    The Fencing Token

    After this lesson you can make a stale lease holder harmless by giving every lease a number that the resource checks, and say where the check has to live.

    DebugFill blankMultiple choiceTrace
    5 exercises
    6 min
  3. 3

    Electing a Leader

    After this lesson you can say what a leader is for, how one is chosen so that at most one exists, what a leader may assume while it holds the lease and what it must not.

    DebugMultiple choiceTrace
    5 exercises
    6 min
  4. 4

    What a Clock Can Tell You

    After this lesson you can say what wall clocks disagree about, which comparisons are safe on a single machine's monotonic clock, and why ordering across machines needs a counter rather than a time.

    DebugFill blankMultiple choiceTrace
    5 exercises
    6 min
  5. 5

    Checkpoint: Coordination and LeasesCheckpoint

    Leases, tokens, elections and clocks for a system you have not seen before.

    DebugMultiple choiceTrace
    7 exercises
    6 min
  6. 6

    Boss: The SchedulerBoss

    One design carried from the ask to the incident: the question, the estimate, the claim, the leader, the paused instance that ran a job twice, the clock that lied, the revised design, and the tradeoff you have to defend.

    Code orderMultiple choiceShort answerTrace
    8 exercises
    9 min