Back to Module 3 notes

This set practises retry semantics, timestamp-based reconciliation, the quorum intersection lemma and the difference between read-after-write consistency and linearizability.

Problem 1

Problem 3.1 (Which requests are safe to retry).

For each update on a state , say whether it is idempotent, and justify in one line.

  1. .
  2. .
  3. on a set .
  4. Append item to the end of a list .
  5. Compare-and-set: if , else , in the two cases and .
  6. A client sends the non-idempotent request “debit 100” with request id 42 to a server that deduplicates by id (Proposition 3.5). Is the combined client-and-server protocol exactly-once? What must the server store, and where?

Problem 2

Problem 3.2 (Anti-entropy with tombstones).

Two replicas hold records with Lamport timestamps written as integers (ties do not occur). Replica A holds and . Replica B holds , and .

  1. Give the state of both replicas after one anti-entropy exchange in which each sends all its records to the other.
  2. Which keys can a client read, and with which values?
  3. Suppose that before the exchange, A had garbage-collected its tombstone for (so A holds no record for ). What does the exchange produce now, and which client-visible anomaly is this?
  4. A late retry of the write for reaches A after the exchange of part 1. What happens?

Problem 3

Problem 3.3 (Quorums that miss each other).

A store has replicas A to E, all initially holding for key . It uses the client protocol of Module 3 with read repair.

  1. With , , give an execution in which client P completes and then P’s own returns . Which property is violated?
  2. Now take . P’s write is acknowledged by C, D, E. Q then reads and the first three responses come from A, B, C. What does Q return, and which messages does read repair send?
  3. In part 2, after the read repair, suppose D and E crash. Can a read still succeed? Can a write? Can both reads and writes survive the crash of D, E and C?

Problem 4

Problem 3.4 (Write quorums must also intersect).

Lemma 3.14 is about a read quorum and a write quorum.

  1. Prove that if , any two write quorums share a replica.
  2. Give , , with but , and two concurrent writes and that complete with disjoint write quorums. After both complete, what does a quorum read return, and is any replica guaranteed to hold the winning value?
  3. Prove: with , a quorum read always contains a replica of each completed write quorum, even when write quorums are disjoint. Why does part 2 therefore not break read-after-write?

Problem 5

Problem 3.5 (Is this execution linearizable).

Three replicas, , initial value with timestamp . Consider each execution and say whether it is allowed by (a) the plain quorum protocol of Module 3 and (b) linearizability. If an execution is allowed by (a) but not (b), name the step the ABD write-back phase changes.

  1. Client 1’s completes. Then client 2’s get returns .
  2. Client 1’s is in progress. Client 2’s get returns and completes. Then client 3’s get returns .
  3. Client 1’s is in progress. Client 2’s get returns and completes. Then client 3’s get returns .