1. Home
  2. Explore
  3. Computer Science
  4. Distributed Systems Consensus

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Distributed Systems Consensus

  • 78Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Consensus Foundations
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is consensus in a distributed system?

Tap to flipClick to flipspace

Consensus is the process by which multiple independent processes agree on one value for a specific decision.

Or swipe the card

78 cards

  1. What is consensus in a distributed system?

    Consensus is the process by which multiple independent processes agree on one value for a specific decision.

  2. What happens to a value after it is chosen through consensus?

    It becomes the single source of truth for that decision across the system.

  3. Why is consensus needed in a distributed online game?

    It ensures that updates, such as acquiring a rare item, are recorded consistently across all game servers.

  4. How can consensus support shared configuration services?

    It ensures that all services use the same current configuration settings.

  5. What are the two broad goals of a consensus algorithm?

    Safety and liveness.

  6. What does safety mean in consensus?

    The system never makes an incorrect or contradictory decision.

  7. What does liveness mean in consensus?

    The system eventually chooses a value and processes eventually learn that value.

  8. Why is a single central acceptor inadequate for fault-tolerant consensus?

    It creates a single point of failure; if it crashes or becomes unreachable, no further progress is possible.

  9. What problem is Paxos designed to address?

    Paxos enables distributed processes to agree on one value despite unreliable communication and process failures.

  10. What is the asynchronous, non-Byzantine model assumed by Paxos?

    Processes may run at arbitrary speeds and crash or restart; messages may be delayed, duplicated, or lost, but processes and messages do not intentionally lie or become corrupted.

  11. What does asynchrony imply about process speeds?

    Processes may run at unpredictable speeds, pause for long periods, or stop altogether.

  12. What can happen when a process restarts in the Paxos model?

    It may not remember information it held before the crash.

  13. Why is stable storage necessary in Paxos?

    Acceptors must preserve critical promises and accepted proposals across crashes and restarts.

  14. What are examples of stable storage technologies or techniques?

    Disk storage, write-ahead logging, journaling, NVMe drives, and persistent memory.

  15. What communication failures are allowed in Paxos?

    Messages may take arbitrarily long to arrive, be duplicated, or be lost entirely.

  16. What does non-Byzantine mean in the Paxos model?

    Processes may crash or be slow, but they do not act maliciously or intentionally send false information.

  17. What is the main difficulty caused by asynchrony?

    Uncertainty: it may be impossible to tell whether a process is slow or failed, or whether a message is delayed or lost.

  18. What is the role of a proposer in Paxos?

    A proposer suggests a value and initiates attempts to have a proposal chosen.

  19. What is the role of an acceptor in Paxos?

    An acceptor responds to proposals, makes promises, and accepts proposals while enforcing consistency.

  20. What is the role of a learner in Paxos?

    A learner discovers which proposal was chosen and uses that result to update its state or take action.

  21. Are Paxos roles necessarily assigned to separate physical machines?

    No. One physical process can act as a proposer, acceptor, and learner.

  22. When is a value considered chosen in basic Paxos?

    When a majority of acceptors has accepted the same proposal.

  23. Why does Paxos use a majority of acceptors?

    Any two majorities must overlap in at least one acceptor.

  24. How does majority intersection prevent two different values from being chosen?

    If two proposals each had a majority, their majorities would share an acceptor; if an acceptor could accept only one value, both proposals could not be chosen.

  25. What is the naive P1 rule?

    An acceptor accepts the first proposal it receives.

  26. How can the naive P1 rule prevent progress?

    Concurrent proposers may cause different acceptors to accept different values, leaving every proposal without a majority.

  27. Why must Paxos distinguish proposals by more than their values?

    An acceptor may need to accept multiple proposals across different rounds, so each proposal needs a unique number.

  28. What is the structure of a Paxos proposal?

    A proposal is a pair consisting of a unique, increasing proposal number and a value.

  29. What does property P2 state?

    If a proposal with value VVV is chosen, every higher-numbered proposal that is chosen must also have value VVV.

  30. What does property P2A strengthen?

    If a proposal with value VVV is chosen, every higher-numbered proposal accepted by any acceptor must have value VVV.

  31. What limitation of P2A leads to P2B?

    P2A does not prevent a proposer from issuing a conflicting higher-numbered proposal before acceptors learn that the earlier value was chosen.

  32. What does property P2B state?

    If a proposal with value VVV is chosen, every higher-numbered proposal issued by any proposer must also have value VVV.

  33. What is the purpose of P2C?

    P2C provides the practical condition that proposers can maintain to ensure P2B.

  34. What are the two conditions in P2C for issuing proposal number NNN with value VVV?

    For a majority of acceptors, either none has accepted a proposal numbered below NNN, or VVV is the value of the highest-numbered proposal below NNN accepted by that majority.

  35. What happens under P2C if no acceptor in the selected majority has accepted a lower-numbered proposal?

    The proposer may choose its own intended value.

  36. What happens under P2C if lower-numbered proposals were accepted?

    The proposer must use the value from the highest-numbered previously accepted proposal among the selected majority.

  37. What are the two phases of the Paxos algorithm?

    Phase 1 is prepare, or promise; phase 2 is accept, or propose.

  38. What does a proposer do at the start of Phase 1?

    It selects a new proposal number higher than any number it has previously used for that consensus instance and sends a prepare request to a majority.

  39. What does an acceptor do when it receives a prepare request with a sufficiently high number?

    It records that number as its highest promise in stable storage and promises not to accept lower-numbered proposals.

  40. What does an acceptor return in a successful promise response?

    It confirms its promise and reports its highest-numbered previously accepted proposal, if one exists.

  41. How does an acceptor respond to a prepare request that is not higher than its existing promise?

    It ignores the request and does not respond.

  42. When may a proposer enter Phase 2?

    After receiving promise responses from a majority of acceptors.

  43. How does a proposer select the value for its Phase 2 proposal?

    If any promise response contains an accepted proposal, it uses the value from the highest-numbered one; otherwise, it uses its own intended value.

  44. What does a proposer send in Phase 2?

    An accept request containing the selected proposal number and value to the same majority of acceptors.

  45. When does an acceptor accept a Phase 2 request?

    It accepts if the proposal number is greater than or equal to its current highest promise.

  46. What happens if an acceptor receives a Phase 2 request below its current promise?

    It ignores or rejects the request.

  47. What does an acceptor do after accepting a proposal?

    It records the proposal in stable storage and typically sends an accepted message to the proposer and possibly to learners.

  48. How does a proposer know that a value has been chosen?

    It receives accepted messages for the same proposal from a majority of acceptors.

  49. Which acceptor state must survive a crash?

    Its highest promise and its highest-numbered accepted proposal.

  50. Do proposers require stable storage for Paxos safety?

    No. A proposer may forget a failed attempt, provided it uses a new higher proposal number when retrying.

  51. How can learners discover a chosen value in the simplest notification scheme?

    Every acceptor sends accepted messages to every learner, and a learner identifies a majority for the same proposal.

  52. What is the communication trade-off of having every acceptor notify every learner?

    It can create approximately acceptors multiplied by learners messages for one decision.

  53. How does a distinguished learner reduce communication overhead?

    Acceptors send accepted messages to one distinguished learner, which informs the other learners after observing a majority.

  54. What is the drawback of using one distinguished learner?

    It can become a bottleneck or a single point of failure for disseminating the chosen value.

  55. How can systems improve the reliability of distinguished learners?

    They can use a small set of distinguished learners rather than only one.

  56. How can a learner recover if it suspects a value was chosen but never learned which value?

    It can query acceptors or initiate a new Paxos round with a sufficiently high proposal number.

  57. What is livelock?

    A condition in which processes remain active and exchange messages but make no progress toward choosing a value.

  58. How can multiple proposers cause Paxos livelock?

    They can repeatedly issue higher-numbered prepare requests that preempt one another before any Phase 2 request gains a majority.

  59. What does the FLP impossibility result state?

    In a purely asynchronous system with possible process crashes, no deterministic consensus algorithm can guarantee both safety and termination if even one process may fail.

  60. What can be added to obtain guaranteed progress despite the FLP result?

    Randomness or real-time assumptions such as timeouts.

  61. How does electing a distinguished proposer or leader improve liveness?

    It reduces competing proposals by allowing one process to lead new proposal attempts.

  62. Is leader election necessary for Paxos safety?

    No. Leader election improves liveness but is not required for Paxos to prevent conflicting chosen values.

  63. What is state machine replication?

    It runs identical deterministic state-machine programs on multiple replicas and supplies them with the same commands in the same order.

  64. Why must a replicated state machine be deterministic?

    The same initial state and command sequence must always produce the same states and outputs.

  65. How does Paxos implement a replicated command sequence?

    It runs a separate Paxos instance for each log position, with the chosen value for each instance being the command for that position.

  66. What roles can each replica play in state machine replication?

    Each replica can act as a proposer, acceptor, and learner for every Paxos instance.

  67. How does a leader typically process a client command?

    It assigns the command to the next log slot and uses the corresponding Paxos instance to make that command the chosen value for the slot.

  68. Why must all replicas execute commands in the same order?

    Different command orders can produce different final states.

  69. What does a new leader do when it finds gaps in the replicated log?

    It runs Phase 1 for each missing slot to recover an earlier value or determine that the slot was unused.

  70. What does a new leader propose if Phase 1 discovers a previously accepted value for a missing slot?

    It proposes that recovered value in Phase 2.

  71. What is a no-op command in state machine replication?

    A placeholder command that fills an empty log slot without changing the state.

  72. Why can stable leaders often skip Phase 1 for later log slots?

    They may already have standing promises from acceptors for a range of future slots.

  73. What is the normal-case communication cost of Paxos under a stable leader?

    Consensus can often complete with one Phase 2 round trip: a message from the leader and responses from a majority.

  74. What happens to safety if no leader is elected in a replicated state-machine system?

    Progress stops, but the system remains consistent and safe.

  75. What happens if multiple servers mistakenly believe they are leaders?

    They may cause livelock by competing for the same slot, but Paxos still prevents two different commands from being chosen for that slot.

  76. How can Paxos support reconfiguration of the acceptor group?

    The membership configuration is stored as part of the replicated state machine and changed through a special consensus command.

  77. When does a new configuration take effect?

    After the configuration-change command is chosen and executed, later consensus operations can use the new acceptor set.

  78. What foundational techniques does Paxos illustrate for reliable distributed infrastructure?

    Majority voting, phased commits, proactive promises, and stable storage.

Card 1 of 78
Card 1 of 78

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent