1. Home
  2. Explore
  3. Computer Science
  4. Paxos Consensus Algorithm

Study methods

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

Paxos Consensus Algorithm

  • 58Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Consensus and Design
Paxos is
.

58 questions

  1. 1
    Paxos is
    _____
    .
    Hint

    Describe both what kind of algorithms Paxos includes and their purpose.

    Answer

    a family of distributed algorithms used to reach consensus

    Explanation

    Paxos names a family of distributed algorithms for reaching consensus; this presentation focuses on vanilla Paxos.

  2. 2
    Although Paxos has many variants, the algorithm discussed here is
    _____
    .
    Hint

    Which version of the algorithm is the presentation focused on?

    Answer

    vanilla Paxos

    Explanation

    Paxos has many variants, but the algorithm discussed here is vanilla Paxos.

  3. 3
    An algorithm is distributed when it runs in
    _____
    .
    Hint

    Think about the collection of machines on which a distributed algorithm runs.

    Answer

    a set of computers or nodes

    Explanation

    In this context, distributed means that the algorithm runs across multiple computers or nodes.

  4. 4
    Consensus is
    _____
    .
    Hint

    What must the participants ultimately do with respect to the result?

    Answer

    agreeing on one result

    Explanation

    Consensus means reaching agreement on one result, rather than merely making proposals.

  5. 5
    In Paxos, a proposal is considered to have reached consensus once
    _____
    agrees on it.
    Hint

    The required group is more than half of the relevant participants.

    Answer

    a majority

    Explanation

    In the Paxos world described here, a proposal is considered to have reached consensus once a majority agrees on it.

  6. 6
    A reached consensus can be
    _____
    .
    Hint

    Consensus information may take time to spread, but what is its eventual reach?

    Answer

    eventually known by everyone

    Explanation

    After consensus is reached, everyone can eventually learn that it was reached and what the agreement was.

  7. 7
    In Paxos, the involved parties want to agree on
    _____
    rather than on their proposal.
    Hint

    The goal is agreement on the outcome, rather than insisting on a participant's original choice.

    Answer

    any result

    Explanation

    Participants in Paxos aim to agree on a result, not necessarily on the particular value any one of them proposed.

  8. 8
    A faulty communication channel may mean that
    _____
    .
    Hint

    What can happen to a message when a communication channel fails?

    Answer

    messages can get lost

    Explanation

    Communication channels may be faulty, so a message sent between participants may not arrive.

  9. 9
    A single computer cannot be
    _____
    .
    Hint

    Why might a growing service need to move beyond one workstation?

    Answer

    an infinitely powerful and scalable single computer

    Explanation

    A single computer has a limit; continually upgrading resources cannot provide infinite power or scalability.

  10. 10
    In a leader-replicas schema, when a value is proposed,
    _____
    .
    Hint

    Describe the leader's role in ordering and distributing proposed writes.

    Answer

    the leader serializes the different proposals and sends them to all the replicas

    Explanation

    In a leader-replicas schema, clients direct proposals to the leader, which orders them and distributes them to the replicas.

  11. 11
    In a peer-to-peer schema,
    _____
    .
    Hint

    Unlike a leader-replicas design, this schema gives the nodes equal status.

    Answer

    all nodes are the same and behave the same

    Explanation

    In a peer-to-peer schema, nodes have equal roles rather than relying on one leader to coordinate proposals.

  12. 12
    When a leader becomes unavailable, nodes must reach consensus to
    _____
    or the system may stall.
    Hint

    What must nodes agree on when the current leader can no longer serve?

    Answer

    elect a new one

    Explanation

    If the leader becomes unavailable, the nodes in a leader-replicas system need consensus to choose a replacement; otherwise the system stalls.

  13. 13
    In a peer-to-peer system, continuous consensus helps guarantee consistency by ensuring that
    _____
    .
    Hint

    What must consensus guarantee about the sequence of operations across nodes?

    Answer

    operations are applied in the same order everywhere

    Explanation

    Peer-to-peer nodes continually reach consensus so that their operations remain consistent in ordering.

  14. 14
    The Paxos role that proposes values for consensus is called a
    _____
    .
    Hint

    Which Paxos role initiates a proposed value?

    Answer

    proposers

    Explanation

    Proposers put forward values for the system to reach consensus on.

  15. 15
    The Paxos role that contributes to reaching consensus by accepting proposals is called an
    _____
    .
    Hint

    Which role participates in the protocol's acceptance decisions?

    Answer

    acceptors

    Explanation

    Acceptors contribute to reaching consensus by responding to protocol messages and accepting proposals.

  16. 16
    The Paxos role that learns the agreed-upon value is called a
    _____
    .
    Hint

    Which role finds out the result after it has been agreed upon?

    Answer

    learners

    Explanation

    Learners learn the agreed-upon value and can later be queried about it.

  17. 17
    In practice, a Paxos node can take
    _____
    .
    Hint

    A server can propose, participate in acceptance, and learn the result.

    Answer

    multiple roles, even all of them

    Explanation

    In practice, one Paxos node can act as a proposer, acceptor, and learner rather than having a single role.

  18. 18
    Paxos nodes must know
    _____
    .
    Hint

    What must nodes know to identify the group size needed for a decision?

    Answer

    how many acceptors a majority is

    Explanation

    Paxos nodes need to know the acceptor count so they can determine what constitutes a majority.

  19. 19
    A key property used by Paxos is that
    _____
    .
    Hint

    What intersection property of majorities supports Paxos's guarantees?

    Answer

    two majorities will always overlap in at least one node

    Explanation

    The overlap between any two majorities ensures that a later majority encounters at least one acceptor from an earlier majority.

  20. 20
    Paxos nodes must be
    _____
    so that they do not forget what they accepted.
    Hint

    Nodes must not forget accepted information after a restart or other interruption.

    Answer

    persistent

    Explanation

    Vanilla Paxos requires nodes to retain what they have accepted, even when communication channels are faulty.

  21. 21
    A Paxos run aims at reaching
    _____
    .
    Hint

    How many agreements on values does one run aim to produce?

    Answer

    a single consensus

    Explanation

    One Paxos run aims to reach agreement on one value; changing that value requires a different run.

  22. 22
    If a value must mutate over time,
    _____
    must happen.
    Hint

    What must begin if a system needs to agree on a changed value?

    Answer

    a different Paxos run

    Explanation

    Once a value has been chosen in a run, that run does not move on to a different value; a new run is needed for a mutation.

  23. 23
    At the start of a Paxos run, a proposer sends a PREPARE ID message to
    _____
    .
    Hint

    The proposer needs to contact enough acceptors to obtain a majority response.

    Answer

    a majority or all of the acceptors

    Explanation

    A proposer begins the prepare phase by sending its PREPARE ID message to a majority or to all acceptors.

  24. 24
    Each Paxos proposal ID must be
    _____
    .
    Hint

    An ID used for one proposal cannot be used again.

    Answer

    unique

    Explanation

    Proposal IDs must never be reused, so each proposal can be distinguished from proposals with other IDs.

  25. 25
    After a timeout, a proposer retries with
    _____
    .
    Hint

    The retry ID must be greater than the one used in the timed-out attempt.

    Answer

    a new, higher ID

    Explanation

    After a timeout, the proposer retries using a higher ID so that its new attempt can supersede earlier proposals.

  26. 26
    When an acceptor receives PREPARE for an ID, it first checks whether it has
    _____
    .
    Hint

    The acceptor checks whether an earlier commitment prevents it from responding to this ID.

    Answer

    promised to ignore requests with that ID

    Explanation

    An acceptor ignores a PREPARE request if it has already made a promise that excludes requests with that ID.

  27. 27
    On responding to an eligible PREPARE, an acceptor promises to ignore
    _____
    .
    Hint

    The new promise protects against proposals numbered below the prepare ID.

    Answer

    any request lower than that ID

    Explanation

    If the acceptor has not already promised to ignore the requested ID, it promises to ignore requests with lower IDs.

  28. 28
    An acceptor that grants a prepare request replies with
    _____
    .
    Hint

    Recall the name of the response sent during the prepare phase.

    Answer

    PROMISE ID

    Explanation

    An acceptor responds to a prepare request with a PROMISE message carrying the proposal ID.

  29. 29
    After a majority of acceptors promises on a particular ID,
    _____
    .
    Hint

    Use the fact that any two majorities share at least one acceptor.

    Answer

    no ID lower than that ID can make it through

    Explanation

    Once a majority has promised on an ID, the overlap between majorities prevents a lower ID from obtaining the majority needed to proceed.

  30. 30
    Once a proposer has a majority of PROMISE messages for an ID, it sends an
    _____
    with that ID and a value.
    Hint

    This message asks acceptors to accept the proposed value in the next phase.

    Answer

    ACCEPT REQUEST

    Explanation

    After receiving a majority of PROMISE messages for an ID, the proposer sends an ACCEPT REQUEST carrying that ID and a value.

  31. 31
    When a proposer receives no previously accepted value in its promises, it may initially choose
    _____
    .
    Hint

    This freedom applies when no accepted value is reported back to the proposer.

    Answer

    any value it wants

    Explanation

    If the proposer has not received a previously accepted value in the promises, it may choose any value it wants to propose.

  32. 32
    If an acceptor can honor an ACCEPT REQUEST, it sends
    _____
    .
    Hint

    Name the response that records an eligible acceptance.

    Answer

    ACCEPT with that ID and that value

    Explanation

    An acceptor that has not promised to ignore the ACCEPT REQUEST sends an ACCEPT message containing its ID and value.

  33. 33
    When an acceptor accepts a proposal, it also sends the ACCEPT message to
    _____
    .
    Hint

    Besides the proposer, which participants receive ACCEPT messages?

    Answer

    all the learners

    Explanation

    Acceptors send their ACCEPT messages to the proposers and to all learners so learners can find out what was accepted.

  34. 34
    If a majority of acceptors accepts a particular ID and value,
    _____
    .
    Hint

    What is the result when enough acceptors accept a proposal?

    Answer

    consensus is reached

    Explanation

    A majority of acceptors accepting the same ID and value establishes consensus on that value.

  35. 35
    Paxos reaches consensus on
    _____
    rather than on the ID.
    Hint

    Distinguish the user-visible proposal from the protocol's internal identifier.

    Answer

    the value

    Explanation

    Consensus is on the proposed value; the ID is an internal Paxos artifact and is not the agreed result.

  36. 36
    A proposer or learner knows that consensus has been reached when it receives
    _____
    for a particular ID.
    Hint

    What set of acceptance messages lets a proposer or learner recognize the decision?

    Answer

    a majority of ACCEPT messages

    Explanation

    A proposer or learner knows consensus has been reached on a value when it receives ACCEPT messages from a majority for that proposal.

  37. 37
    The three milestones in a Paxos run always happen
    _____
    .
    Hint

    The milestones do not occur in arbitrary order; one follows another.

    Answer

    sequentially

    Explanation

    The three milestones in a Paxos run occur in order: a majority promises, a majority accepts, and a proposer or learner learns the result.

  38. 38
    The first Paxos milestone is that
    _____
    .
    Hint

    This is the first of the three milestones, before acceptances are counted.

    Answer

    a majority of acceptors promise on an ID

    Explanation

    The first milestone is a majority promising on an ID, which prevents lower IDs from making it through.

  39. 39
    The second Paxos milestone is that
    _____
    .
    Hint

    This milestone turns a proposed value into the consensus result.

    Answer

    a majority of acceptors accept an ID and value

    Explanation

    The second milestone establishes consensus on the value through a majority of acceptor responses.

  40. 40
    The third Paxos milestone is that
    _____
    .
    Hint

    This milestone concerns learning that the earlier majority acceptance occurred.

    Answer

    a proposer or learner gets a majority of ACCEPT messages

    Explanation

    The third milestone is when a proposer or learner receives enough ACCEPT messages to know consensus has been reached.

  41. 41
    If a proposer receives previously accepted values in its promises, it must select
    _____
    .
    Hint

    Compare the accepted IDs carried in the promises and preserve the value attached to the greatest one.

    Answer

    the value with the highest accepted ID that it got

    Explanation

    When promises report previously accepted values, a proposer must choose the value associated with the highest accepted ID among those reported.

  42. 42
    When a later prepare encounters an already accepted proposal, the new proposal uses a higher ID but must carry
    _____
    .
    Hint

    The proposal number can change while the chosen content remains unchanged.

    Answer

    the same value

    Explanation

    A later proposal may use a higher ID, but a previously accepted value reported in the promises must be preserved.

  43. 43
    Several competing proposals in the same Paxos run can cause
    _____
    .
    Hint

    What problem arises when proposals keep stepping over one another?

    Answer

    contention

    Explanation

    Several proposers issuing competing proposals in one Paxos run can repeatedly supersede one another and create contention.

  44. 44
    Several proposals on the same Paxos run can cause
    _____
    that yield contention.
    Hint

    The material uses this term for concentrated activity that contributes to contention.

    Answer

    hotspots

    Explanation

    Multiple proposals on the same run can create hotspots that yield contention and potentially stall progress.

  45. 45
    A potential solution to contention between proposers is to use
    _____
    .
    Hint

    Think of a retry strategy that increases waiting time after repeated conflicts.

    Answer

    exponential backoff

    Explanation

    A possible solution to proposal contention is exponential backoff, which gives one proposal time to complete before another retry competes.

  46. 46
    In the contention example, exponential backoff leaves
    _____
    .
    Hint

    What opportunity should the increased waiting time provide?

    Answer

    enough time for any of the proposals to go through entirely

    Explanation

    Waiting through exponential backoff can create a window for one proposal to finish the Paxos run before another proposal interferes.

  47. 47
    After a higher ID has received a majority of promises, a lower-ID accept request cannot be accepted by a majority because it would require
    _____
    .
    Hint

    Identify the prerequisite that the lower-numbered proposal cannot satisfy.

    Answer

    a majority of promises for the lower ID

    Explanation

    A lower-ID accept request cannot be accepted by a majority after a higher-ID majority has promised, because the lower request would first need a majority of promises.

  48. 48
    After a majority accepts a proposal, at least one acceptor in a later majority will piggyback
    _____
    in its promise.
    Hint

    The later proposer learns prior acceptance through information carried in a promise.

    Answer

    the accepted ID and value

    Explanation

    After a value has been accepted by a majority, a later prepare is guaranteed to encounter an acceptor that reports that accepted ID and value.

  49. 49
    After a majority accepts a value, later proposals with higher IDs can be accepted only with
    _____
    .
    Hint

    A higher ID is allowed, but the outcome must not change.

    Answer

    the same value

    Explanation

    Higher-ID proposals can still proceed after consensus, but the piggybacked accepted value forces them to preserve the value already chosen.

  50. 50
    Piggybacking an accepted value allows proposers and learners to
    _____
    even if they missed a majority of ACCEPT messages earlier.
    Hint

    What can a proposer find out from the value piggybacked on a later promise?

    Answer

    learn about Paxos consensus

    Explanation

    A proposer that missed earlier ACCEPT messages can discover the consensus by preparing again and receiving the accepted value in an acceptor's promise.

  51. 51
    To represent a changing bank account using Paxos, the system uses
    _____
    .
    Hint

    The solution is a sequence of agreed entries replicated across storage nodes.

    Answer

    a replicated log

    Explanation

    A bank account changes over time, so the storage system records changes as separate positions in a replicated log rather than trying to change one Paxos value.

  52. 52
    When a value needs to mutate, a new consensus begins on
    _____
    .
    Hint

    A new change is recorded after the previously agreed log entry.

    Answer

    the next log position

    Explanation

    Whenever the account value needs to change, the system starts a new consensus on the next position in the log.

  53. 53
    In the example, the bank account's initial state at its opening date is recorded at
    _____
    .
    Hint

    The initial account state is stored at the beginning of the sequence.

    Answer

    log position 0

    Explanation

    The first log position represents the initial state of the bank account at its opening date.

  54. 54
    After a transfer is recorded, a later withdrawal must be recorded at
    _____
    .
    Hint

    The withdrawal cannot overwrite the earlier transfer entry in the log.

    Answer

    a different log position

    Explanation

    A withdrawal is a new account change, so it must be recorded as a separate log entry and agreed upon in a separate consensus.

  55. 55
    When a client proposes a write, the storage server acts as
    _____
    .
    Hint

    Which Paxos role does the client's storage server take when initiating a write?

    Answer

    a Paxos Proposer

    Explanation

    The storage server that receives a client's proposed write acts as a proposer and sends the proposal to the acceptors.

  56. 56
    In the three-replica storage example, when the proposer and another acceptor accept the request,
    _____
    .
    Hint

    The threshold is satisfied when a majority of the three acceptors accepts.

    Answer

    consensus has been reached

    Explanation

    When the proposer and enough acceptors accept the request to form a majority, the write has reached consensus.

  57. 57
    If only two replicas write a value at first, the third replica will eventually
    _____
    .
    Hint

    The lagging replica does not have to write at exactly the same time as the others.

    Answer

    eventually figure out the value

    Explanation

    A replica that did not write the value initially can catch up later or learn it through a subsequent proposal for the relevant log position.

  58. 58
    When a lagging replica tries to propose again to catch up, it does so for
    _____
    .
    Hint

    The later proposal moves forward in the account's ordered sequence of entries.

    Answer

    the next log position

    Explanation

    A replica that catches up by proposing again uses the next log position and can learn the prior accepted value through the ACCEPT message.

1 of 58
Question 1 of 58

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent