Paxos Made Moderately Complex � Robert Van Renesse � Cornell University �
Problems Addressed � • Implementation of Multi-Decree Paxos � • Not a simple protocol! � • Liveness � • How to make Paxos live without overly simplifying? � • Practicality of Paxos � • How to make Paxos more pragmatic? �
Comparison with the Required Paper � • What’s adopted? � • The multi-paxos protocol � • Basic state reduction optimizations � • What’s new? � • Very detailed pseudocode � • More cool optimizations! �
Pseudocode �
Working of the Pseudocode � • Leader uses scouts to get the next ballot number � • Clients bcast the requests to replicas � • Replicas propose the commands � • Leaders instruct commanders to carry out the voting � • Decision is relayed back to the clients �
Message Sequence Chart � Multi-decree paxos in action �
Components and States � • Replicas � • Maintain a state, slot_num, proposal set, decision set � • Leaders � • Manage different proposals using different ballots � • Responsible for relaying a decision to the replicas � • Monitor other leaders when passive � • Acceptors � • They are the voters � • “Memory of Paxos” � • Scouts and Commanders � • Identify acceptors for a particular <ballot, slot, proposal> triplet - p1a message � • Preempt if higher ballots are running for the same proposal �
Pragmatism with Paxos � • State Reduction � • Already discussed in the required paper � • Garbage Collection � • Read-only commands � • Collocation of replicas �
• Garbage Collection � • When all replicas know of a decision for a slot, that information can be discarded from the acceptor. � • Replica tells leader, leader informs acceptors � • 2f + 1 replicas to safely perform garbage collection � • Read-Only Command optimization � • Once a leader’s ballot is accepted, “attach” RO request to the update � • Use only one replica instead of all the replicas � • Using “leases”, a leader can become THE president. � • No need of jumping through all the hoops � • When the leaders and replicas are collocated… � • Mostly they are collocated � • Can send to local leaders instead of broadcasting to all leaders �
Takeaways � • Exercise with 10 programming questions asking you to do all the optimizations! � • Full fledged pseudocode � • Critical Optimizations for a practical implementation � • Garbage Collection � • Read-Only optimization � • Collocation �
Recommend
More recommend