Why is multi-paxos called multi-paxos?

2019-04-28 11:43发布

问题:

Why multi-paxos is called multi-paxos? I can't see how it is "multi".

回答1:

It's about multiple rounds of the algorithm to agree sequential requests from a stable leader with minimal messaging. Initially with no recognised leader you must run at least one round of basic Paxos where a candidate leader sends a prepare request (using the terminology of the paper Paxos Made Simple). Positive responses from a majority confirm it as leader. It then sends accept messages for that round which terminates successfully if you get a majority of accept acknowledgements. Rather than start again with prepare requests it can move immediately to a galloping mode where it sends successive accept messages when it hears a majority of acknowledgments for the previous accept request. This is highly efficient as it needs the minimal number of messages but it only occurs for multiple rounds from a stable leader. This may be interrupted by the leader crashing else a network failure which causes a follower to timeout on an otherwise healthy leader. It will then issue its own prepare request as a leadership challenge which is resolved via basic Paxos rules. As soon as you get a stable leader it can upgrade to multi-Paxos galloping mode.



回答2:

There are two phases in paxos which need many messages to be exchanged. In order to optimize the paxos protocol, we try running the phase only when needed. Phase one talks are all about "Leader Election". There is no point to run this phase again and again for getting every entry in the log (State Machine Replication Problem). We run it only when the leader fails. This is the time when the leader is selected for the "log" and not only for per entry in the log. Multi-paxos implies the same leader is handling multiple client requests without running the leader election again and again.