Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi-raft extension support #22

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ default = [
members = [
"datacake-node",
"datacake-eventual-consistency",
"datacake-multi-raft",
"datacake-crdt",
"datacake-sqlite",
"datacake-rpc",
Expand Down
22 changes: 22 additions & 0 deletions datacake-multi-raft/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "datacake-multi-raft"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tracing = "0.1.36"
bytecheck = "0.6.9"
thiserror = "1"
flume = "0.10.14"
slog = "2.7.0"

puppet = { version = "0.4.0", default-features = false }
raft = { git = "https://github.com/lnx-search/raft-rs.git", default-features = false, features = ["protobuf-codec"] }
tokio = { version = "1", default-features = false, features = ["sync", "time"] }
rkyv = { version = "0.7.9", features = ["validation"] }

datacake-rpc = { path = "../datacake-rpc", version = "0.2" }
datacake-node = { path = "../datacake-node", version = "0.1" }
datacake-crdt = { path = "../datacake-crdt", version = "0.3", features = ["rkyv-support"] }
5 changes: 5 additions & 0 deletions datacake-multi-raft/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mod membership;
mod node;



13 changes: 13 additions & 0 deletions datacake-multi-raft/src/membership.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

#[derive(Debug)]
/// The type of membership behaviour the cluster should exhibit.
pub enum MembershipMode {
/// Uses a fixed subset of nodes within the system to create the raft cluster.
Fixed(Vec<String>),
/// Similar to [MembershipMode::Fixed] however, this allows for dynamic adding
/// and removal of nodes from the cluster.
Dynamic(Vec<String>),
/// Automatically include all nodes in the system and add nodes which join the
/// cluster.
Auto,
}
Empty file added datacake-multi-raft/src/node.rs
Empty file.