Raft: Leader Election and Log Replication · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.

Raft elects, then replicates

Computing · Networks & Security · ages 22-23
Name ______________________   Date ____________
  1. When is an entry that the leader added in its own term committed?

    • When the leader thinks of it
    • When one follower glimpses it
    • Once a majority holds it
  2. What does Raft use to number its elections?

    • Terms
    • Lottery tickets
    • Port numbers
  3. In Raft each node votes at most once per term.

    Circle one:   True   False

  4. The leader fails after an entry it added in its own term reached three of five nodes. What happens to it?

    • It is lost with the leader
    • It returns to the client unsent
    • It survives on the new leader
  5. Two candidates campaign in term 5, and any two majorities share a voter. Why can only one of them win?

    • The slower candidate always gives up once the other starts
    • Both need a majority, and the shared voter votes only once
    • Terms forbid a second candidate from campaigning at all
  6. In a five-node cluster, an entry sits only on the failed leader's log. What is its fate?

    • It may be lost, since no majority holds it
    • It always survives, because the leader wrote it first
    • It commits by itself once a new leader is elected
  7. A four-node cluster splits into two groups of two. Each group's candidate runs in term 6. Can either group elect a leader while the split lasts?

    • Yes, each candidate holds a majority inside its own group
    • No, a majority of four is three and each group has two
    • Yes, the group whose candidate started first wins
  8. A proposed rule lets any node win an election, even one with a stale log. Which bad history can follow?

    • Two leaders win the same term and decide differently
    • Votes split so often that elections never finish quickly
    • A new leader that lacks entries a majority had committed
LightMySky · lightmysky.comW1-mt_JdHtEJSPSP-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

Raft elects, then replicates W1-mt_JdHtEJSPSP-s1

  1. Once a majority holds it · Majority storage is the commitment threshold.
  2. Terms · Each election belongs to its term.
  3. True · Single voting is what bars two winners.
  4. It survives on the new leader · Three of five is a majority, so the entry is committed.
  5. Both need a majority, and the shared voter votes only once · Each winner needs a majority. Any two majorities share a voter, and that voter votes once per term.
  6. It may be lost, since no majority holds it · One copy is not a majority, so the entry was never committed and may be dropped.
  7. No, a majority of four is three and each group has two · A majority of four is three. Each group has two nodes, so neither can win while the split lasts.
  8. A new leader that lacks entries a majority had committed · A stale winner may lack committed entries. The up-to-date rule exists to block that loss.
Worksheet · LightMySky