zowens / paxos-rs Goto Github PK
View Code? Open in Web Editor NEWPaxos implementation in Rust
License: MIT License
Paxos implementation in Rust
License: MIT License
Implement distinguished proposer role, as defined in Paxos Made Simple.
Phase 1 executed gives the Proposer Phase 1 for instances >= current
Currently, once a distinguished proposer is selected, there is no way to detect failure of the DP from the other replicas. In addition, the proposer itself is unable to know if it still will be able to maintain quorum. The proposer itself is also subject to failing to get Phase 2 quorum if some nodes miss ACCEPT messages.
The PigPaxos paper shows a novel idea to use a peer replica to broadcast communication to reduce the computational needs on the Paxos leader. This could be an interesting extension.
Batching multiple proposals into a single instance increases throughput of the algorithm. We should attempt to batch multiple into a single algo::Value
A possible issue is the max size of UDP packets
It is awkward currently to handle a state machine and in the same vein support client requests for proposals. It would be nice to have library-level features to make programming with this model easier.
More examples! A replicated log would add an additional example that showcases the library.
It may also be useful to evaluate publishing examples as crates themselves for consumption by other systems.
The library currently implements proposal pipelining, where multiple instances may be decided concurrently. Add in the option to batch multiple proposals and send these out to the replicas as a single request.
Vec<Bytes>
tick()
Last step to getting this out into Crates.io! It turns out paxos is taken, so we need a different name.
Some ideas:
When a proposal is executed, the decision command is still held within the SlotWindow
. To properly implement truncation, this needs to be propagated to through the Paxos protocol.
There should be model checking tests that run as unit tests. This can be accomplished with something like stateright.
Paxos used in a WAN setting would need some additional considerations. The WPaxos paper and Paxi implementation provide a framework for separating the object space for use in a WAN setting.
Instead of the cli and server being in src/bin
, there should be multiple crates for:
Currently it's possible for a replica to drop out, come back into the cluster and not learn of old instances. In this condition the state machine is not applied at that replica.
Allow Phase 1 and Phase 2 quorums to be differently sized. This should be a configuration option.
We currently do not limit the number of in-flight proposals or open instances, which could lead to an OOM condition. In the Paxos Made Simple paper the value alpha is chosen as the max number.
The Paxos state must be applied to persistent storage. The easiest to plug in may be RocksDB.
In most uses of Paxos, read heavy workloads do not need to traverse the entire Paxos protocol (at least Phase 2). In the Paxos made Live paper, the authors describe a read lease concept wherein reads are cordoned to a leader node. This should reduce the latency impact for most reads.
Add a feature-enabled default transport implementation that can be used out-of-the-box.
Add in the configuration learners/observers that do not participate in Phase 1 or Phase 2 quorum, but learn of decisions.
The current traits are disjointed between the various stack levels for the core replica and liveness mode. It would be nice to have a unified trait that encompasses the common subset functions needed to be a replica.
The trait for replicas should also contain convenience functions to stack functionality.
pub trait Replica: Commander {
// leader election functions election
fn propose_leadership(&mut self);
fn is_leader(&self) -> bool;
// move tick over to the replica from Tick trait
fn tick(&mut self);
// access the decisions
fn decisions_mut(&mut self) -> DecisionSet;
// Convenience functions to add additional functionality
fn liveness(self) -> Liveness<Self> { Liveness::new(self) }
fn logged(self, level: log::Level) -> Logged<Self> { Logged::new(self, level) }
fn state_machine(self, state: ReplicatedState) -> StateMachine<Self> { StateMachine::new(self, state) }
fn notify(self, listener: Listener) -> Notified<Self> { Notified::new(self, listener) }
}
Add optional serde
feature that adds Serialize
and Deserialize
implementations for RPC types. In addition, the ReplicatedState
trait should be updated to utilize custom types for commands.
We need to support reconfiguration at the Paxos protocol layer. In addition, having a JOIN/LEAVE type primitive is necessary for bootstrapping.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.