From c94406f4282d48e2e2ac82ffb57eafaad23f7edc Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 9 Nov 2021 12:24:04 +0100 Subject: Improve how node roles are assigned in Garage - change the terminology: the network configuration becomes the role table, the configuration of a nodes becomes a node's role - the modification of the role table takes place in two steps: first, changes are staged in a CRDT data structure. Then, once the user is happy with the changes, they can commit them all at once (or revert them). - update documentation - fix tests - implement smarter partition assignation algorithm This patch breaks the format of the network configuration: when migrating, the cluster will be in a state where no roles are assigned. All roles must be re-assigned and commited at once. This migration should not pose an issue. --- Cargo.nix | 83 ++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 42 insertions(+), 41 deletions(-) (limited to 'Cargo.nix') diff --git a/Cargo.nix b/Cargo.nix index 5307d1e2..2e0804d5 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -40,13 +40,13 @@ in { cargo2nixVersion = "0.9.0"; workspace = { - garage_util = rustPackages.unknown.garage_util."0.4.0"; - garage_rpc = rustPackages.unknown.garage_rpc."0.4.0"; - garage_table = rustPackages.unknown.garage_table."0.4.0"; - garage_model = rustPackages.unknown.garage_model."0.4.0"; - garage_api = rustPackages.unknown.garage_api."0.4.0"; - garage_web = rustPackages.unknown.garage_web."0.4.0"; - garage = rustPackages.unknown.garage."0.4.0"; + garage_util = rustPackages.unknown.garage_util."0.5.0"; + garage_rpc = rustPackages.unknown.garage_rpc."0.5.0"; + garage_table = rustPackages.unknown.garage_table."0.5.0"; + garage_model = rustPackages.unknown.garage_model."0.5.0"; + garage_api = rustPackages.unknown.garage_api."0.5.0"; + garage_web = rustPackages.unknown.garage_web."0.5.0"; + garage = rustPackages.unknown.garage."0.5.0"; }; "registry+https://github.com/rust-lang/crates.io-index".aho-corasick."0.7.18" = overridableMkRustCrate (profileName: rec { name = "aho-corasick"; @@ -246,7 +246,7 @@ in registry = "registry+https://github.com/rust-lang/crates.io-index"; src = fetchCratesIo { inherit name version; sha256 = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469"; }; dependencies = { - ${ if hostPlatform.config == "aarch64-apple-darwin" || hostPlatform.parsed.cpu.name == "aarch64" && hostPlatform.parsed.kernel.name == "linux" then "libc" else null } = rustPackages."registry+https://github.com/rust-lang/crates.io-index".libc."0.2.103" { inherit profileName; }; + ${ if hostPlatform.parsed.cpu.name == "aarch64" && hostPlatform.parsed.kernel.name == "linux" || hostPlatform.config == "aarch64-apple-darwin" then "libc" else null } = rustPackages."registry+https://github.com/rust-lang/crates.io-index".libc."0.2.103" { inherit profileName; }; }; }); @@ -606,9 +606,9 @@ in }; }); - "unknown".garage."0.4.0" = overridableMkRustCrate (profileName: rec { + "unknown".garage."0.5.0" = overridableMkRustCrate (profileName: rec { name = "garage"; - version = "0.4.0"; + version = "0.5.0"; registry = "unknown"; src = fetchCrateLocal (workspaceSrc + "/src/garage"); dependencies = { @@ -616,12 +616,12 @@ in bytes = rustPackages."registry+https://github.com/rust-lang/crates.io-index".bytes."1.1.0" { inherit profileName; }; futures = rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.17" { inherit profileName; }; futures_util = rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.17" { inherit profileName; }; - garage_api = rustPackages."unknown".garage_api."0.4.0" { inherit profileName; }; - garage_model = rustPackages."unknown".garage_model."0.4.0" { inherit profileName; }; - garage_rpc = rustPackages."unknown".garage_rpc."0.4.0" { inherit profileName; }; - garage_table = rustPackages."unknown".garage_table."0.4.0" { inherit profileName; }; - garage_util = rustPackages."unknown".garage_util."0.4.0" { inherit profileName; }; - garage_web = rustPackages."unknown".garage_web."0.4.0" { inherit profileName; }; + garage_api = rustPackages."unknown".garage_api."0.5.0" { inherit profileName; }; + garage_model = rustPackages."unknown".garage_model."0.5.0" { inherit profileName; }; + garage_rpc = rustPackages."unknown".garage_rpc."0.5.0" { inherit profileName; }; + garage_table = rustPackages."unknown".garage_table."0.5.0" { inherit profileName; }; + garage_util = rustPackages."unknown".garage_util."0.5.0" { inherit profileName; }; + garage_web = rustPackages."unknown".garage_web."0.5.0" { inherit profileName; }; git_version = rustPackages."registry+https://github.com/rust-lang/crates.io-index".git-version."0.3.5" { inherit profileName; }; hex = rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }; sodiumoxide = rustPackages."registry+https://github.com/rust-lang/crates.io-index".kuska-sodiumoxide."0.2.5-0" { inherit profileName; }; @@ -638,9 +638,9 @@ in }; }); - "unknown".garage_api."0.4.0" = overridableMkRustCrate (profileName: rec { + "unknown".garage_api."0.5.0" = overridableMkRustCrate (profileName: rec { name = "garage_api"; - version = "0.4.0"; + version = "0.5.0"; registry = "unknown"; src = fetchCrateLocal (workspaceSrc + "/src/api"); dependencies = { @@ -651,9 +651,9 @@ in err_derive = buildRustPackages."registry+https://github.com/rust-lang/crates.io-index".err-derive."0.3.0" { profileName = "__noProfile"; }; futures = rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.17" { inherit profileName; }; futures_util = rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.17" { inherit profileName; }; - garage_model = rustPackages."unknown".garage_model."0.4.0" { inherit profileName; }; - garage_table = rustPackages."unknown".garage_table."0.4.0" { inherit profileName; }; - garage_util = rustPackages."unknown".garage_util."0.4.0" { inherit profileName; }; + garage_model = rustPackages."unknown".garage_model."0.5.0" { inherit profileName; }; + garage_table = rustPackages."unknown".garage_table."0.5.0" { inherit profileName; }; + garage_util = rustPackages."unknown".garage_util."0.5.0" { inherit profileName; }; hex = rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }; hmac = rustPackages."registry+https://github.com/rust-lang/crates.io-index".hmac."0.10.1" { inherit profileName; }; http = rustPackages."registry+https://github.com/rust-lang/crates.io-index".http."0.2.5" { inherit profileName; }; @@ -673,9 +673,9 @@ in }; }); - "unknown".garage_model."0.4.0" = overridableMkRustCrate (profileName: rec { + "unknown".garage_model."0.5.0" = overridableMkRustCrate (profileName: rec { name = "garage_model"; - version = "0.4.0"; + version = "0.5.0"; registry = "unknown"; src = fetchCrateLocal (workspaceSrc + "/src/model"); dependencies = { @@ -683,9 +683,9 @@ in async_trait = buildRustPackages."registry+https://github.com/rust-lang/crates.io-index".async-trait."0.1.51" { profileName = "__noProfile"; }; futures = rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.17" { inherit profileName; }; futures_util = rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.17" { inherit profileName; }; - garage_rpc = rustPackages."unknown".garage_rpc."0.4.0" { inherit profileName; }; - garage_table = rustPackages."unknown".garage_table."0.4.0" { inherit profileName; }; - garage_util = rustPackages."unknown".garage_util."0.4.0" { inherit profileName; }; + garage_rpc = rustPackages."unknown".garage_rpc."0.5.0" { inherit profileName; }; + garage_table = rustPackages."unknown".garage_table."0.5.0" { inherit profileName; }; + garage_util = rustPackages."unknown".garage_util."0.5.0" { inherit profileName; }; hex = rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }; log = rustPackages."registry+https://github.com/rust-lang/crates.io-index".log."0.4.14" { inherit profileName; }; netapp = rustPackages."registry+https://github.com/rust-lang/crates.io-index".netapp."0.3.0" { inherit profileName; }; @@ -698,9 +698,9 @@ in }; }); - "unknown".garage_rpc."0.4.0" = overridableMkRustCrate (profileName: rec { + "unknown".garage_rpc."0.5.0" = overridableMkRustCrate (profileName: rec { name = "garage_rpc"; - version = "0.4.0"; + version = "0.5.0"; registry = "unknown"; src = fetchCrateLocal (workspaceSrc + "/src/rpc"); dependencies = { @@ -709,7 +709,7 @@ in bytes = rustPackages."registry+https://github.com/rust-lang/crates.io-index".bytes."1.1.0" { inherit profileName; }; futures = rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.17" { inherit profileName; }; futures_util = rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.17" { inherit profileName; }; - garage_util = rustPackages."unknown".garage_util."0.4.0" { inherit profileName; }; + garage_util = rustPackages."unknown".garage_util."0.5.0" { inherit profileName; }; gethostname = rustPackages."registry+https://github.com/rust-lang/crates.io-index".gethostname."0.2.1" { inherit profileName; }; hex = rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }; hyper = rustPackages."registry+https://github.com/rust-lang/crates.io-index".hyper."0.14.13" { inherit profileName; }; @@ -719,15 +719,16 @@ in rand = rustPackages."registry+https://github.com/rust-lang/crates.io-index".rand."0.8.4" { inherit profileName; }; rmp_serde = rustPackages."registry+https://github.com/rust-lang/crates.io-index".rmp-serde."0.15.5" { inherit profileName; }; serde = rustPackages."registry+https://github.com/rust-lang/crates.io-index".serde."1.0.130" { inherit profileName; }; + serde_bytes = rustPackages."registry+https://github.com/rust-lang/crates.io-index".serde_bytes."0.11.5" { inherit profileName; }; serde_json = rustPackages."registry+https://github.com/rust-lang/crates.io-index".serde_json."1.0.68" { inherit profileName; }; tokio = rustPackages."registry+https://github.com/rust-lang/crates.io-index".tokio."1.12.0" { inherit profileName; }; tokio_stream = rustPackages."registry+https://github.com/rust-lang/crates.io-index".tokio-stream."0.1.7" { inherit profileName; }; }; }); - "unknown".garage_table."0.4.0" = overridableMkRustCrate (profileName: rec { + "unknown".garage_table."0.5.0" = overridableMkRustCrate (profileName: rec { name = "garage_table"; - version = "0.4.0"; + version = "0.5.0"; registry = "unknown"; src = fetchCrateLocal (workspaceSrc + "/src/table"); dependencies = { @@ -735,8 +736,8 @@ in bytes = rustPackages."registry+https://github.com/rust-lang/crates.io-index".bytes."1.1.0" { inherit profileName; }; futures = rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.17" { inherit profileName; }; futures_util = rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.17" { inherit profileName; }; - garage_rpc = rustPackages."unknown".garage_rpc."0.4.0" { inherit profileName; }; - garage_util = rustPackages."unknown".garage_util."0.4.0" { inherit profileName; }; + garage_rpc = rustPackages."unknown".garage_rpc."0.5.0" { inherit profileName; }; + garage_util = rustPackages."unknown".garage_util."0.5.0" { inherit profileName; }; hexdump = rustPackages."registry+https://github.com/rust-lang/crates.io-index".hexdump."0.1.1" { inherit profileName; }; log = rustPackages."registry+https://github.com/rust-lang/crates.io-index".log."0.4.14" { inherit profileName; }; rand = rustPackages."registry+https://github.com/rust-lang/crates.io-index".rand."0.8.4" { inherit profileName; }; @@ -748,9 +749,9 @@ in }; }); - "unknown".garage_util."0.4.0" = overridableMkRustCrate (profileName: rec { + "unknown".garage_util."0.5.0" = overridableMkRustCrate (profileName: rec { name = "garage_util"; - version = "0.4.0"; + version = "0.5.0"; registry = "unknown"; src = fetchCrateLocal (workspaceSrc + "/src/util"); dependencies = { @@ -775,18 +776,18 @@ in }; }); - "unknown".garage_web."0.4.0" = overridableMkRustCrate (profileName: rec { + "unknown".garage_web."0.5.0" = overridableMkRustCrate (profileName: rec { name = "garage_web"; - version = "0.4.0"; + version = "0.5.0"; registry = "unknown"; src = fetchCrateLocal (workspaceSrc + "/src/web"); dependencies = { err_derive = buildRustPackages."registry+https://github.com/rust-lang/crates.io-index".err-derive."0.3.0" { profileName = "__noProfile"; }; futures = rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.17" { inherit profileName; }; - garage_api = rustPackages."unknown".garage_api."0.4.0" { inherit profileName; }; - garage_model = rustPackages."unknown".garage_model."0.4.0" { inherit profileName; }; - garage_table = rustPackages."unknown".garage_table."0.4.0" { inherit profileName; }; - garage_util = rustPackages."unknown".garage_util."0.4.0" { inherit profileName; }; + garage_api = rustPackages."unknown".garage_api."0.5.0" { inherit profileName; }; + garage_model = rustPackages."unknown".garage_model."0.5.0" { inherit profileName; }; + garage_table = rustPackages."unknown".garage_table."0.5.0" { inherit profileName; }; + garage_util = rustPackages."unknown".garage_util."0.5.0" { inherit profileName; }; http = rustPackages."registry+https://github.com/rust-lang/crates.io-index".http."0.2.5" { inherit profileName; }; hyper = rustPackages."registry+https://github.com/rust-lang/crates.io-index".hyper."0.14.13" { inherit profileName; }; log = rustPackages."registry+https://github.com/rust-lang/crates.io-index".log."0.4.14" { inherit profileName; }; -- cgit v1.2.3