我正在学习 MIT 6.824 课程,我有一个关于 paxos 的问题。当提议者向接受者发送准备时,接受者将返回一个带有 n 和 v 的 prepare_ok 最高接受者看到。我想知道为什么接受者需要返回 n 和 v?
问问题
190 次
1 回答
3
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.
于 2015-09-24T05:18:39.893 回答