3
$\begingroup$

In the second phase of the paxos algorithm, the proposer issues an accept request with the number n and the value v it got from the acceptor, if the acceptor has already chosen a value previously. My questions is why the proposer is doing this? Because once a value if chosen it is permanent and cannot be changed, so in this case the proposer is just learning the chosen value, which was sent in the response of the prepare request. Why would it asks to accept a value already accepted?

$\endgroup$

1 Answer 1

1
$\begingroup$

This is to make sure that consensus value won't change.

For example, let's say we have a system with two proposers (P1, P2) and three acceptors (A1, A2, A3) (and few learners).

Let's say that both P1 and P2 are trying to get their values accepted: V1 and V2.

Due to some delay (e.g. garbage collector, network issue) P2 is delayed, so P1 gets its value V1 to all acceptors. As soon as two nodes accepted the value, the consensus is reached and learners will learn about it.

Now P2 wakes up (or network gets a fix) - P2 offers its value to every acceptor, but gets back [some N, V1]. If P2 ignores V1 and keep pushing V2 - that will override the current value, and consensus will change - learners will see that suddenly there is another value as agreed one.

To make sure the selected value never changes, proposers have to re-propose a value which has been already proposed, instead of pushing their new one.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.