Skip to content

Lecture 05. Coordination, failure detection and leader election ​

Week 9 · Syllabus and preparation from the course outline; no study date or personal lecture notes have been recorded.

Business scenario ​

Three Delivery Coordinator instances are running. The service should assign couriers through one active coordinator and reject stale leaders.

Topics to cover in this class ​

  1. Heartbeats, lease expiry, incomplete failure detection and false suspicion
  2. Bully election or a scoped term-based election under a crash-only model
  3. Epochs / fencing tokens, atomic database ownership checks and stale leadership
  4. Split brain in partitions; safe assignment and unique active courier constraints
  5. Controlled container failures, recovery logs and declared safety assumptions

Learning objectives ​

  • Demonstrate coordinator election and failover.
  • Prevent a stale coordinator from committing a new assignment.
  • Describe limitations of heartbeat-only election.

Live demonstration checklist ​

  • Start three coordinator containers with distinct IDs and expose role/epoch status.
  • Stop leader, observe election, restart old leader and reject stale write.

Preparation and optional written reflection (ungraded) ​

Reading focus: Read introductory Raft leader election discussion; compare consensus with a simple bully election. Optional individual reflection: Explain why two nodes can both believe they are leader and what a fencing token can prevent.

Study materials: official docs, websites and YouTube ​

Built with VitePress · Notes © 2026 [Your Name]