diff --git a/Cargo.lock b/Cargo.lock index 24ba28bfbd..46467233b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1170,9 +1170,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.6" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] @@ -1231,12 +1231,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - [[package]] name = "cfg_aliases" version = "0.2.1" @@ -1374,7 +1368,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim 0.11.1", "terminal_size", ] @@ -1555,18 +1549,18 @@ dependencies = [ [[package]] name = "const_format" -version = "0.2.32" +version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" +checksum = "50c655d81ff1114fb0dcdea9225ea9f0cc712a6f8d189378e82bdf62a473a64b" dependencies = [ "const_format_proc_macros", ] [[package]] name = "const_format_proc_macros" -version = "0.2.32" +version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" +checksum = "eff1a44b93f47b1bac19a27932f5c591e43d1ba357ee4f61526c8a25603f0eb1" dependencies = [ "proc-macro2", "quote", @@ -1621,9 +1615,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpp_demangle" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" +checksum = "96e58d342ad113c2b878f16d5d034c03be492ae460cdbc02b7f0f2284d310c7d" dependencies = [ "cfg-if", ] @@ -1846,12 +1840,12 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.4.4" +version = "3.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345" +checksum = "90eeab0aa92f3f9b4e87f258c72b139c207d251f9cbc1080a0086b86a8870dd3" dependencies = [ - "nix 0.28.0", - "windows-sys 0.52.0", + "nix 0.29.0", + "windows-sys 0.59.0", ] [[package]] @@ -3096,15 +3090,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", "hyper 0.14.30", "log", - "rustls 0.21.11", + "rustls 0.21.12", "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", @@ -3257,9 +3251,9 @@ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "inferno" -version = "0.11.19" +version = "0.11.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "321f0f839cd44a4686e9504b0a62b4d69a50b62072144c71c68f5873c167b8d9" +checksum = "232929e1d75fe899576a3d5c7416ad0d88dbfbb3c3d6aa00873a7408a50ddb88" dependencies = [ "ahash", "indexmap 2.2.6", @@ -3328,9 +3322,9 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "iri-string" -version = "0.7.0" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21859b667d66a4c1dacd9df0863b3efb65785474255face87f5bca39dd8407c0" +checksum = "dc0f0a572e8ffe56e2ff4f769f32ffe919282c3916799f8b68688b6030063bea" dependencies = [ "memchr", "serde", @@ -3607,13 +3601,12 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall", ] [[package]] @@ -3714,9 +3707,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" dependencies = [ "libc", ] @@ -3949,18 +3942,6 @@ dependencies = [ "libc", ] -[[package]] -name = "nix" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cfg_aliases 0.1.1", - "libc", -] - [[package]] name = "nix" version = "0.29.0" @@ -3969,7 +3950,7 @@ checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ "bitflags 2.6.0", "cfg-if", - "cfg_aliases 0.2.1", + "cfg_aliases", "libc", ] @@ -4210,7 +4191,7 @@ dependencies = [ "http 0.2.12", "http-body 0.4.6", "hyper 0.14.30", - "hyper-rustls 0.24.1", + "hyper-rustls 0.24.2", "hyper-timeout 0.4.1", "jsonwebtoken", "once_cell", @@ -4288,9 +4269,9 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "open" -version = "5.1.3" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb49fbd5616580e9974662cb96a3463da4476e649a7e4b258df0de065db0657" +checksum = "61a877bf6abd716642a53ef1b89fb498923a4afca5c754f9050b4d081c05c4b3" dependencies = [ "is-wsl", "libc", @@ -4475,9 +4456,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pathdiff" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +checksum = "d61c5ce1153ab5b689d0c074c4e7fc613e942dfb7dd9eea5ab202d2ad91fe361" [[package]] name = "pbkdf2" @@ -5125,9 +5106,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -6486,9 +6467,9 @@ dependencies = [ [[package]] name = "rgb" -version = "0.8.37" +version = "0.8.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05aaa8004b64fd573fc9d002f4e632d51ad4f026c2b5ba95fcb6c2f32c2c47d8" +checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" dependencies = [ "bytemuck", ] @@ -6586,9 +6567,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.11" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring", @@ -7179,9 +7160,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" @@ -7232,9 +7213,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "symbolic-common" -version = "12.8.0" +version = "12.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cccfffbc6bb3bb2d3a26cd2077f4d055f6808d266f9d4d158797a4c60510dfe" +checksum = "366f1b4c6baf6cfefc234bbd4899535fca0b06c74443039a73f6dfb2fad88d77" dependencies = [ "debugid", "memmap2", @@ -7244,9 +7225,9 @@ dependencies = [ [[package]] name = "symbolic-demangle" -version = "12.8.0" +version = "12.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a99812da4020a67e76c4eb41f08c87364c14170495ff780f30dd519c221a68" +checksum = "aba05ba5b9962ea5617baf556293720a8b2d0a282aa14ee4bf10e22efc7da8c8" dependencies = [ "cpp_demangle", "rustc-demangle", @@ -7561,7 +7542,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.11", + "rustls 0.21.12", "tokio", ] @@ -8120,9 +8101,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vergen" -version = "8.3.1" +version = "8.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" +checksum = "2990d9ea5967266ea0ccf413a4aa5c42a93dbcfda9cb49a97de6931726b12566" dependencies = [ "anyhow", "cargo_metadata", @@ -8375,6 +8356,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" diff --git a/crates/admin/Cargo.toml b/crates/admin/Cargo.toml index 2f3c88e361..aef8ce0e6e 100644 --- a/crates/admin/Cargo.toml +++ b/crates/admin/Cargo.toml @@ -8,11 +8,12 @@ license.workspace = true publish = false [features] -default = [] +default = ["replicated-loglet"] clients = [] servers = [] options_schema = ["restate-service-client/options_schema"] memory-loglet = ["restate-bifrost/memory-loglet"] +replicated-loglet = ["restate-bifrost/replicated-loglet"] [dependencies] restate-admin-rest-model = { workspace = true, features = ["schema"] } diff --git a/crates/admin/src/cluster_controller/logs_controller.rs b/crates/admin/src/cluster_controller/logs_controller.rs index 56f445cf23..66433d2242 100644 --- a/crates/admin/src/cluster_controller/logs_controller.rs +++ b/crates/admin/src/cluster_controller/logs_controller.rs @@ -208,6 +208,7 @@ fn try_provisioning( let log_id = thread_rng().next_u64(); Some(LogletConfiguration::Memory(log_id)) } + #[cfg(feature = "replicated-loglet")] ProviderKind::Replicated => { find_new_replicated_loglet_configuration(observed_cluster_state, None) .map(LogletConfiguration::Replicated) @@ -215,6 +216,7 @@ fn try_provisioning( } } +#[cfg(feature = "replicated-loglet")] fn find_new_replicated_loglet_configuration( observed_cluster_state: &ObservedClusterState, previous_configuration: Option<&ReplicatedLogletParams>, @@ -264,6 +266,7 @@ fn find_new_replicated_loglet_configuration( #[derive(Debug)] enum LogletConfiguration { + #[cfg(feature = "replicated-loglet")] Replicated(ReplicatedLogletParams), Local(u64), #[cfg(any(test, feature = "memory-loglet"))] @@ -273,6 +276,7 @@ enum LogletConfiguration { impl LogletConfiguration { fn as_provider(&self) -> ProviderKind { match self { + #[cfg(feature = "replicated-loglet")] LogletConfiguration::Replicated(_) => ProviderKind::Replicated, LogletConfiguration::Local(_) => ProviderKind::Local, #[cfg(any(test, feature = "memory-loglet"))] @@ -282,6 +286,7 @@ impl LogletConfiguration { fn requires_reconfiguration(&self, observed_cluster_state: &ObservedClusterState) -> bool { match self { + #[cfg(feature = "replicated-loglet")] LogletConfiguration::Replicated(configuration) => { // todo check also whether we can improve the nodeset based on the observed cluster state observed_cluster_state @@ -296,6 +301,7 @@ impl LogletConfiguration { fn to_loglet_params(&self) -> anyhow::Result { Ok(match self { + #[cfg(feature = "replicated-loglet")] LogletConfiguration::Replicated(configuration) => { LogletParams::from(configuration.serialize()?) } @@ -309,21 +315,25 @@ impl LogletConfiguration { &self, observed_cluster_state: &ObservedClusterState, ) -> Option { - let previous_configuration = match self { - LogletConfiguration::Replicated(configuration) => Some(configuration), + match self { + #[cfg(feature = "replicated-loglet")] + LogletConfiguration::Replicated(configuration) => { + find_new_replicated_loglet_configuration( + observed_cluster_state, + Some(configuration), + ) + .map(LogletConfiguration::Replicated) + } LogletConfiguration::Local(_) => { let loglet_id = rand::thread_rng().next_u64(); - return Some(LogletConfiguration::Local(loglet_id)); + Some(LogletConfiguration::Local(loglet_id)) } #[cfg(any(test, feature = "memory-loglet"))] LogletConfiguration::Memory(_) => { let loglet_id = rand::thread_rng().next_u64(); - return Some(LogletConfiguration::Memory(loglet_id)); + Some(LogletConfiguration::Memory(loglet_id)) } - }; - - find_new_replicated_loglet_configuration(observed_cluster_state, previous_configuration) - .map(LogletConfiguration::Replicated) + } } } @@ -335,6 +345,7 @@ impl TryFrom<&LogletConfig> for LogletConfiguration { ProviderKind::Local => Ok(LogletConfiguration::Local(value.params.parse()?)), #[cfg(any(test, feature = "memory-loglet"))] ProviderKind::InMemory => Ok(LogletConfiguration::Memory(value.params.parse()?)), + #[cfg(feature = "replicated-loglet")] ProviderKind::Replicated => { ReplicatedLogletParams::deserialize_from(value.params.as_bytes()) .map(LogletConfiguration::Replicated) diff --git a/server/Cargo.toml b/server/Cargo.toml index 0e0d945c8f..05ed11ffcc 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -26,8 +26,8 @@ options_schema = [ "restate-tracing-instrumentation/options_schema", "restate-types/schemars", ] -memory-loglet = ["restate-node/memory-loglet"] -replicated-loglet = ["restate-node/replicated-loglet"] +memory-loglet = ["restate-node/memory-loglet", "restate-admin/memory-loglet"] +replicated-loglet = ["restate-node/replicated-loglet", "restate-admin/replicated-loglet"] [dependencies] restate-admin = { workspace = true }