Unit 8 of 14 · about 4 hours · explain, implement

Sloppy quorums, hinted handoff and read repair

Fallback replicas keep accepting work when home replicas are unreachable, but change the contract behind the quorum calculation. Repair must carry both version metadata and the identity of the replica that missed the write.

You'll be able to

  • Construct disjoint sloppy response sets despite apparently sufficient read and write thresholds.
  • Implement hints with intended-recipient identity and retry-safe handoff.
  • Implement version-aware read repair and identify keys it cannot repair without reads.

Covers

Sloppy quorums and hinted handoffRead repair
1

Read

In this order, only the parts listed

0 of 2 done

  1. DDIA, 2nd edition: the repair mechanisms and fallback replicasDDIA 2e - Chapter 6 Replication and Chapter 10 Consistency Sections

    Chapter 6, Replication: Catching up on missed writes, p. 231; Single-Leader Versus Leaderless Replication Performance, pp. 235 to 236

  2. Dynamo (SOSP 2007): sloppy quorum and hinted handoffDynamo: Amazon's Highly Available Key-value Store (DeCandia et al., 2007)

    Sections 2.1 to 2.3 for the shopping-cart requirements; Sections 4.2 to 4.3 for preference lists and replication; Sections 4.5 to 4.6 for request execution, sloppy quorum and hinted handoff

    Track the per-key home replica set and substitute healthy nodes. Do not implement consistent hashing here; use a fixed preference list.

2

Focus on

  • Dynamo's sloppy quorum selects healthy nodes from a preference list. Those nodes need not be the fixed home replicas to which a later read goes.
  • A hint records the mutation and its intended recipient. Preserve it until the recipient acknowledges the declared handoff boundary; duplicate delivery must be harmless.
  • Repair must reconcile versioned values, concurrent siblings and deletions. Never replace a sibling set merely because a replica answered first.
  • Read repair repairs accessed data. Handoff repairs retained hints. Neither guarantees that an unread key whose hints were lost will converge.
Common mistakes · 3
  • Counting the same fallback copy twice as two independent home-replica acknowledgements.
  • Deleting a hint when its network send returns rather than when the intended recipient confirms the required state.
  • Applying an old hint as an unconditional overwrite of a newer value or tombstone.
3

Try it yourself

Closed-book, before checking anything

Give a key home replicas A, B and C, with fallbacks D and E. During a partition, acknowledge a write using A and D. Later read B and C while handoff is delayed: both still return the initial value, although both thresholds are two and the home replication factor is three. In Python 3, store a hint on D for B, deliver it twice after healing, and assert that the versioned value is unchanged by duplicate handoff. Then read A and C and repair C using the same reconciliation rule. Leave a second key unread to demonstrate the coverage limit of read repair.
4

Quiz yourself

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

0 got · 0 missed

  1. 1.Why do the two-response write and read sets in the example not have to intersect?Answer

    The write uses a fallback outside the three home replicas. Both response sets are not size-two subsets of the same three-node universe.

  2. 2.Can read repair by itself fix an unread cold key?Answer

    No. Its trigger is a read of that data. Another propagation or background comparison mechanism must cover cold keys.

  3. 3.A hint and the target contain incomparable version vectors. Which one wins?Answer

    Neither causally supersedes the other. Preserve both as siblings or apply an explicitly chosen convergent application policy. Arrival order is not causal order.

  4. 4.Does successful hinted handoff prove linearizability?Answer

    No. It moves missing versions after the fact; it cannot erase stale or contradictory reads already returned to clients.

You're done when

Your trace shows disjoint sloppy response sets, duplicate handoff is idempotent, and the unread key remains divergent until a mechanism other than read repair runs.

Only when you can do this without notes.

Leads to

Notes

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

Also in this section