modkzs
modkzs

Reputation: 1509

Why paxos acceptor must send back any value they have already accepted

I'm learning MIT 6.824 class and I have a question about paxos. When proposer send a prepare to acceptor, acceptor will return a prepare_ok with n and v which highest accept see. I wonder why acceptor need to return n and v?

Upvotes: 2

Views: 266

Answers (1)

Michael Deardeuff
Michael Deardeuff

Reputation: 10697

In a nutshell, the acceptor must return v because if the value was already committed then the new proposer needs to know what it is. There is no global "is_committed" flag, so the proposer gathers all these values and their associated rounds from at least a majority of the acceptors. The proposer then sends the value with the highest round to all the acceptors.

As you can see, a proposer always finishes what another proposer has started when it receives a value from an acceptor. This is a little bit similar to a lot of wait-free algorithms.

Upvotes: 3

Related Questions