Back to Module 8 notes

This set practises the acceptor’s two promises, the adoption rule, the difference between “accepted by a majority” and “chosen”, and the quorum-intersection proof.

Problem 1

Problem 8.1 (One acceptor, step by step).

An acceptor starts with promised = acceptedBallot = acceptedValue = null and receives, in this order: Prepare(3), Accept(2, u), Prepare(2), Accept(3, w), Prepare(5), Accept(4, z), Prepare(6). Ballots are plain integers.

  1. After each message, give the acceptor’s three variables and its reply (Promise, Accepted or Nack, with arguments).
  2. At the end, promised and acceptedBallot differ. Explain in one sentence what each one guarantees to future proposers.

Problem 2

Problem 8.2 (Which value must the proposer send?).

There are acceptors A to E. Proposer P runs ballot 7 for its client’s value . For each set of Promise replies below, say what P sends next (and with which value), or explain why it cannot send anything yet. Replies are written as (acceptor: accepted proposal).

  1. A: none, B: none, C: none.
  2. A: (3, u), B: none, C: (5, w).
  3. A: (5, w), B: (5, w), D: (6, z).
  4. A: (3, u), E: (4, u).
  5. A: (5, w), B: (5, z), C: none.

Problem 3

Problem 8.3 (Accepted by a majority, but not chosen).

Five acceptors A to E. Proposer P1 owns ballot 1, P2 owns 2, P3 owns 3, P4 owns 4. The following happens, in this order.

  1. P1 completes Phase 1 for ballot 1 with {A, B, C} (nothing reported) and sends Accept(1, x); only A receives it, and A accepts.
  2. P2 completes Phase 1 for ballot 2 with {C, D, E} (nothing reported) and sends Accept(2, y) to all; for now, only D receives it, and D accepts.
  3. P3 sends Prepare(3) to {A, B, C}; all three promise. A reports (1, x), B and C report nothing. P3 sends Accept(3, x); B and C accept it, the message to A is lost.
  4. P4 sends Prepare(4) to {A, D, E}; all three promise. P4 sends an Accept, and A, D and E accept it.

Answer:

  1. Is each step allowed by the algorithm? Check every Promise and every acceptance against the acceptor’s promised.
  2. Right after step 3, how many acceptors have accepted some proposal with value ? Is chosen at that moment?
  3. Which value does P4 send in step 4, and is it chosen?
  4. Does this execution violate agreement? Which exam answer does it refute?

Problem 4

Problem 8.4 (Reading the past from acceptor state).

Three acceptors are in this state (the history before is unknown, but the algorithm was followed):

  • A: promised 4, accepted (3, y);

  • B: promised 4, accepted (1, x);

  • C: promised 2, accepted (2, z).

  1. For each of , , , decide whether it can already have been chosen. Justify using the algorithm’s invariants and Theorem 8.8.
  2. A proposer runs ballot 5. Which value must it send if its Phase-1 quorum is {B, C}? {A, B}? {A, C}?
  3. The three answers to part 2 are not all equal. Explain why this does not contradict agreement.

Problem 5

Problem 8.5 (Only Phase-1 and Phase-2 quorums need to meet).

Generalize Paxos: fix a family of Phase-1 quorums and a family of Phase-2 quorums (sets of acceptors) such that every intersects every . A proposer waits for Promises from some and applies the adoption rule to those replies; a proposal is chosen when every acceptor of some accepted it. Everything else is unchanged.

  1. Prove: if is chosen, every issued proposal with has .
  2. With acceptors, let be all sets of 3 acceptors and all sets of 2. Check the intersection condition. Do two Phase-2 quorums always intersect? Why is that not needed?
  3. What is gained and what is lost compared with majorities for both phases when ?
1.
Howard H, Malkhi D, Spiegelman A. Flexible Paxos: Quorum Intersection Revisited. In: Proceedings of the 20th International Conference on Principles of Distributed Systems (OPODIS). 2016. p. 25:1-25:14. (LIPIcs; vol. 70).