Unit 9 of 12 · about 4 hours · explain, implement

Membership join, leave and replacement, versioned views and stale-view handling

A membership list is a replicated object with stale readers. Versioning is what stops a healed partition from resurrecting the dead.

You'll be able to

  • Run join, leave, suspect, alive and failed transitions and say which message overrides which.
  • Version membership views and reject stale ones on receipt and before acting.
  • Handle replacement: a restarted member rejoins without its old identity hijacking the view.

Covers

Membership join, leave and replacementMembership version and stale-view handling
1

Read

In this order, only the parts listed

0 of 2 done

  1. Join, leave and refutationSWIM: Scalable Weakly-consistent Infection-style Process Group Membership (Das et al., 2002)

    Section 3.2 (join through a contact member or coordinator, leave by announcement), Section 4.1 (buffered dissemination), and Section 4.2 (Alive and Suspect incarnation comparisons; terminal Confirm after the suspicion timeout)

  2. The majority rules on death declarationsDDIA 2e - Chapter 9 The Trouble with Distributed Systems

    Chapter 9, The Majority Rules (pp. 372-373): the one-way-listening node, the minute-long pause, and why a quorum must declare death

2

Focus on

  • Join needs a contact: a coordinator, a well-known address, or probabilistic replies. Leave is an announcement over unreliable spread, so treat it as a hint and keep probing.
  • Suspect is not Failed. A suspected member stays on the list and stays a probe target until the timeout passes with no Alive refutation.
  • In original SWIM, Alive at incarnation 4 refutes Suspect at 3, while Suspect overrides Alive at equal incarnation. Confirm overrides both at any incarnation. Do not substitute an incarnation-first rule for terminal failure without explicitly changing the protocol.
  • SWIM membership is weakly consistent, not quorum agreement. DDIA's majority rule concerns coordinated authority: a node whose outgoing messages are lost must honor removal from authority. Replacement needs a fresh process identity or an explicit rejoin protocol so old terminal reports cannot evict the replacement.
Common mistakes · 3
  • Deleting a failed member immediately. Late refutations and delayed messages then have nowhere to land; keep the recently failed alongside the living, as SWIM does.
  • Acting on one reporter's Failed. A partition makes every watcher on one side wrong together; wait for quorum agreement before reassigning work.
  • Trusting leave as certain. A lost leave leaves a ghost member, and a lost join leaves a live stranger; both need the probe path as backup.
3

Try it yourself

Closed-book, before checking anything

Closed-book, apply original SWIM Section 4.2 to member A: Suspect at incarnation 3, Alive at incarnation 4, then Confirm at incarnation 3. Alive first refutes Suspect, but Confirm removes A despite the higher Alive incarnation. Explain why replacement needs a fresh identity or an explicit rejoin protocol.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.Two watchers send Confirm for A at incarnation 3 while A broadcasts Alive at 4. What does original SWIM keep?Answer

    A is removed. Section 4.2 makes Confirm override Alive regardless of incarnation. If the watchers had sent only Suspect at 3, Alive at 4 would refute them.

  2. 2.A node restarts and rejoins with incarnation 0 while the group holds it failed at incarnation 2. What happens without an epoch?Answer

    Its reports lose every comparison, and its old identity shadows the new one. It must rejoin under a fresh epoch the group has never seen.

  3. 3.Why does the book make the one-way-listening node step down instead of defending itself?Answer

    It cannot prove its case to anyone: its outgoing path is dead. Only a quorum decision both sides can observe breaks the symmetry.

  4. 4.A leave announcement never arrives. How does the group still converge?Answer

    Probes keep failing, suspicion rises through the normal path, and the member is declared failed by timeout rather than by announcement.

You're done when

You apply the reproduce sequence and explain each override using both message type and incarnation, without confusing membership reports with exclusive authority.

Only when you can do this without notes.

Leads to

Notes

Resources · 2 for this unit, 12 more in the section

Also in this section

  • Time, Clocks, and the Ordering of Events in a Distributed System (Lamport, 1978)Leslie Lamport · required

    Read the partial ordering and logical clocks sections: happens-before, the Clock Condition, rules IR1 and IR2, and the total order. Its ties are broken arbitrarily, so the total order is not causality.

  • Logical Physical Clocks and Consistent Snapshots (Kulkarni et al., 2014)University at Buffalo · support

    Read the hybrid logical clock algorithm and its bounds; the paper reports the logical counter staying well below its proved bound in practice, so measure your own.

  • The phi Accrual Failure Detector (Hayashibara et al., 2004)JAIST · support

    Read how phi is computed from the heartbeat inter-arrival history and how a threshold trades detection time for false suspicion. Its normal approximation misleads under bursty delay, so test with pause traces too.

  • How to Do Distributed Locking (Kleppmann, 2016)Martin Kleppmann · required

    Read the process-pause, network-delay and fencing-token sections with DDIA 2e Chapter 9 "Distributed Locks and Leases". Treat the Redlock critique as dated to 2016; the lasting lesson is that the storage service must reject a write that carries an older token.

  • Cambridge Concurrent and Distributed Systems Notes (Kleppmann) - Time, Clocks and OrderingUniversity of Cambridge (Martin Kleppmann) · support

    Use Chapter 3 (physical clocks, NTP and monotonic clocks, happens-before) and Section 4.1 (Lamport and vector clocks with worked examples) as the derivation workbook: work Exercises 7 to 13. Each section marks where its public lecture video starts.

  • Building Distributed Systems - The TimekeeperBuild Distributed Systems · optional

    Only the first three tasks are free (clock reads and backward jumps, a monotonic wrapper, a split-brain lease). Tasks are graded in the browser after login, so treat a pass as a drill and keep your local harness as the evidence.

  • Building Distributed Systems - The GossiperBuild Distributed Systems · optional

    Only the first three tasks are free (basic broadcast, tree topology, random gossip). Tasks are graded in the browser after login, so treat a pass as a drill and keep your local harness as the evidence.

  • HLD Handbook - Clocks, Failure Detection and Consistent HashingHLD Handbook · required

    Read Part 3 clocks and ordering, failure detection and consistent hashing. Use its exercises to compare assumptions, then verify claims against your own histories.

  • Gossip Glomers - Unique IDs and BroadcastFly.io and Jepsen · required

    Each challenge runs locally under Maelstrom (v0.2.4; the pages were tested on 0.2.3) with its checker and, where the page says so, the partition nemesis; keep the run directory as the history. Do challenge 2 (unique IDs under partition with total availability) and 3a to 3c (broadcast, then with partitions). A pass shows uniqueness or convergence in that run, not ordering or recency.

  • MIT 6.5840 - Failure and Paper Discussion LensMIT PDOS · support

    Use the RPC, GFS, Raft and consistency lectures to identify which timing assumptions affect progress and which invariants must not depend on time. Do not start the Raft lab yet.

  • Replicated Log and Stream Processor - Time and Membership SliceRoadmap-Final · support

    Add incarnation IDs, logical timestamps, gossip membership, suspicion metrics and fenced ownership. Retain seeds and minimized traces for every false-failure or stale-actor case.

  • AlgoMaster System Design practice - clock, gossip and lease drillsAlgoMaster · support

    Use only the named problems: Advance a Lamport Logical Clock, Compare Two Vector Clocks, Update a Vector Clock on Receive, Advance a Hybrid Logical Clock, Simulate Gossip Rumor Spread and Implement a Lease Lock with Fencing Tokens. Each states its function signature and checks small deterministic cases.