Back to Module 10 notes

These problems use the dictionary of Module 10 in both directions and the lemma “intersecting quorums carry memory”. For Multi-Paxos we use the PMMC names of Module 9. Unless stated otherwise, each server runs a colocated replica, leader and acceptor.

Problem 1

Problem 10.1 (Translate the event).

For each event, name the corresponding event in the other protocol, or explain why there is none.

  1. Raft: a follower rejects an AppendEntries because its is 7 and the request carries term 6.
  2. PMMC: a scout of ballot receives a p1b that contains .
  3. Raft: a follower rejects an AppendEntries because it has no entry at .
  4. PMMC: a leader receives adopted and updates its proposals with pmax.
  5. Raft: a server denies its vote because the candidate’s last entry has a lower term than its own.

Problem 2

Problem 10.2 (One leader change, traced twice).

Five servers S1 to S5. Positions 1 to 3 are decided everywhere. S1 is leader (term 3, ballot ). It replicates command for position 4 to S2 and S3, and both acknowledge, so is committed (decided). It replicates command for position 5 to S2 only. Then S1 crashes.

  1. Raft: write the logs from index 4 on. Which of S2 to S5 can win term 4? For each possible winner, what happens to and to ?
  2. PMMC: S4 starts a scout with ballot and gets p1b from S3, S4 and S5. What does pmax return for slots 4 and 5, and what does S4 propose there? What changes if the p1b come from S2, S4 and S5 instead?
  3. In PMMC, could slot 5 have been decided as before the crash while slot 4 was still undecided? Could the analogous thing happen in Raft?

Problem 3

Problem 10.3 (Counting messages and delays).

A cluster of servers. Count the messages and the one-way message delays from the moment a client sends a write until it receives the reply. Messages from a server to itself are free and instantaneous; ignore heartbeats and retransmissions.

  1. Raft with a stable leader. The leader replies to the client after applying the entry.
  2. Raft, first write after a leader change: the candidate has just timed out when the request arrives, and the client already knows who it is.
  3. PMMC with colocated processes and a stable active leader; the client sends its request to the leader’s server only, and decisions go to all replicas.
  4. Single-decree Paxos run per command, with the same proposer every time.

Which counts match, and why is the comparison between 1 and 4 not fair?

Problem 4

Problem 10.4 (Quorums that are not majorities).

Let . Raft uses a vote quorum of size and a commit quorum of size ; Paxos uses a Phase-1 quorum of size and a Phase-2 quorum of size .

  1. Using the lemma “intersecting quorums carry memory”, show that Paxos with and still satisfies C2: a value chosen at ballot is proposed by every commander of a higher ballot.
  2. Show that Paxos with and is also safe, but that Raft with and is not. Which Raft property fails, and why does Paxos not need it?
  3. Show by an execution that is unsafe for Paxos.
  4. Show that the lemma fails if acceptors may forget on restart, even with majorities: give an execution with in which two different values are chosen for one slot.

Problem 5

Problem 10.5 (True or false).

Decide each claim and justify your answer in two or three sentences.

  1. “Paxos is leaderless, so it never needs an election.”
  2. “A new Raft leader never receives log entries from its followers; a new PMMC leader always receives the accepted pvalues of a majority.”
  3. “Because Paxos renumbers adopted values under its own ballot, it does not need Raft’s current-term commit rule.”
  4. “A Multi-Paxos replica may execute slot 7 before slot 6 is decided, because slots are independent.”
  5. “Raft and Multi-Paxos both implement total order broadcast, and both deliver the commands of one client in the order the client sent them.”