diff --git a/Cargo.lock b/Cargo.lock index c3c911b4b4..d6255695ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1154,7 +1154,7 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "tokio", "tower", "tower-layer", @@ -1199,12 +1199,6 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f879ef8fc74665ed7f0e6127cb106315888fc2744f68e14b74f83edbb2a08992" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -1245,7 +1239,7 @@ dependencies = [ "figment", "futures", "hdrhistogram", - "metrics", + "metrics 0.23.0", "metrics-exporter-prometheus", "once_cell", "quanta", @@ -2400,13 +2394,13 @@ dependencies = [ [[package]] name = "derive-getters" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2c35ab6e03642397cdda1dd58abbc05d418aef8e36297f336d5aba060fe8df" +checksum = "0a6433aac097572ea8ccc60b3f2e756c661c9aeed9225cdd4d0cb119cb7ff6ba" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.65", ] [[package]] @@ -2422,33 +2416,33 @@ dependencies = [ [[package]] name = "derive_builder" -version = "0.12.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7" dependencies = [ "derive_builder_macro", ] [[package]] name = "derive_builder_core" -version = "0.12.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" dependencies = [ - "darling 0.14.4", + "darling 0.20.8", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.65", ] [[package]] name = "derive_builder_macro" -version = "0.12.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 1.0.109", + "syn 2.0.65", ] [[package]] @@ -3313,6 +3307,7 @@ checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown 0.14.3", + "serde", ] [[package]] @@ -3484,6 +3479,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.10" @@ -3666,7 +3670,7 @@ dependencies = [ [[package]] name = "librocksdb-sys" version = "0.17.0+9.0.0" -source = "git+https://github.com/restatedev/rust-rocksdb?rev=64a3c698910380e4fcbd8e56ce459779932cf1ff#64a3c698910380e4fcbd8e56ce459779932cf1ff" +source = "git+https://github.com/restatedev/rust-rocksdb?rev=c7ccbbcd261bdec011c4976c441676512a1a4841#c7ccbbcd261bdec011c4976c441676512a1a4841" dependencies = [ "bindgen", "bzip2-sys", @@ -3824,17 +3828,27 @@ dependencies = [ "portable-atomic", ] +[[package]] +name = "metrics" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884adb57038347dfbaf2d5065887b6cf4312330dc8e94bc30a1a839bd79d3261" +dependencies = [ + "ahash", + "portable-atomic", +] + [[package]] name = "metrics-exporter-prometheus" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d58e362dc7206e9456ddbcdbd53c71ba441020e62104703075a69151e38d85f" +checksum = "26eb45aff37b45cff885538e1dcbd6c2b462c04fe84ce0155ea469f325672c98" dependencies = [ "base64 0.22.0", "hyper-util", "indexmap 2.2.6", - "metrics", - "metrics-util", + "metrics 0.23.0", + "metrics-util 0.17.0", "quanta", "thiserror", "tokio", @@ -3849,8 +3863,25 @@ dependencies = [ "indexmap 2.2.6", "itoa", "lockfree-object-pool", - "metrics", - "metrics-util", + "metrics 0.22.3", + "metrics-util 0.16.3", + "once_cell", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "metrics-tracing-context" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62a6a1f7141f1d9bc7a886b87536bbfc97752e08b369e1e0453a9acfab5f5da4" +dependencies = [ + "indexmap 2.2.6", + "itoa", + "lockfree-object-pool", + "metrics 0.23.0", + "metrics-util 0.17.0", "once_cell", "tracing", "tracing-core", @@ -3868,7 +3899,26 @@ dependencies = [ "crossbeam-utils", "hashbrown 0.14.3", "indexmap 2.2.6", - "metrics", + "metrics 0.22.3", + "num_cpus", + "ordered-float 4.2.0", + "quanta", + "radix_trie", + "sketches-ddsketch", +] + +[[package]] +name = "metrics-util" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4259040465c955f9f2f1a4a8a16dc46726169bca0f88e8fb2dbeced487c3e828" +dependencies = [ + "aho-corasick", + "crossbeam-epoch", + "crossbeam-utils", + "hashbrown 0.14.3", + "indexmap 2.2.6", + "metrics 0.23.0", "num_cpus", "ordered-float 4.2.0", "quanta", @@ -5219,9 +5269,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "regress" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f5f39ba4513916c1b2657b72af6ec671f091cd637992f58d0ede5cae4e5dea0" +checksum = "0eae2a1ebfecc58aff952ef8ccd364329abe627762f5bf09ff42eb9d98522479" dependencies = [ "hashbrown 0.14.3", "memchr", @@ -5229,9 +5279,9 @@ dependencies = [ [[package]] name = "regress" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eae2a1ebfecc58aff952ef8ccd364329abe627762f5bf09ff42eb9d98522479" +checksum = "16fe0a24af5daaae947294213d2fd2646fbf5e1fbacc1d4ba3e84b2393854842" dependencies = [ "hashbrown 0.14.3", "memchr", @@ -5265,7 +5315,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-rustls 0.24.1", @@ -5350,7 +5400,7 @@ dependencies = [ name = "restate-base64-util" version = "1.1.0" dependencies = [ - "base64 0.21.7", + "base64 0.22.0", ] [[package]] @@ -5391,7 +5441,7 @@ dependencies = [ "futures", "googletest", "humantime", - "metrics", + "metrics 0.23.0", "once_cell", "pin-project", "restate-core", @@ -5429,7 +5479,7 @@ dependencies = [ "arrow_convert", "axum", "base62", - "base64 0.21.7", + "base64 0.22.0", "bs58", "bytes", "chrono", @@ -5452,7 +5502,7 @@ dependencies = [ "hyper-util", "indicatif", "indoc", - "itertools 0.11.0", + "itertools 0.13.0", "jsonwebtoken", "octocrab", "open", @@ -5474,7 +5524,7 @@ dependencies = [ "toml_edit 0.22.13", "tower", "tracing", - "typify 0.1.0", + "typify", "url", "uuid", "vergen", @@ -5524,7 +5574,7 @@ dependencies = [ "http 0.2.12", "humantime", "hyper 0.14.28", - "metrics", + "metrics 0.23.0", "once_cell", "pin-project", "prost", @@ -5628,7 +5678,7 @@ dependencies = [ "humantime", "hyper 1.2.0", "hyper-util", - "metrics", + "metrics 0.23.0", "opentelemetry", "opentelemetry_sdk", "pin-project-lite", @@ -5660,7 +5710,7 @@ name = "restate-ingress-kafka" version = "1.1.0" dependencies = [ "anyhow", - "base64 0.21.7", + "base64 0.22.0", "bytes", "derive_builder", "opentelemetry", @@ -5709,8 +5759,8 @@ dependencies = [ "h2 0.3.26", "humantime", "hyper 0.14.28", - "itertools 0.11.0", - "metrics", + "itertools 0.13.0", + "metrics 0.23.0", "opentelemetry", "opentelemetry-http", "opentelemetry_sdk", @@ -5798,10 +5848,10 @@ dependencies = [ "http 0.2.12", "humantime", "hyper 0.14.28", - "metrics", + "metrics 0.23.0", "metrics-exporter-prometheus", - "metrics-tracing-context", - "metrics-util", + "metrics-tracing-context 0.16.0", + "metrics-util 0.17.0", "once_cell", "prost-types", "restate-admin", @@ -5869,7 +5919,7 @@ dependencies = [ "static_assertions", "strum 0.26.2", "strum_macros 0.26.2", - "sync_wrapper", + "sync_wrapper 1.0.1", "tempfile", "thiserror", "tokio", @@ -5903,7 +5953,7 @@ dependencies = [ "derive_more", "futures", "futures-util", - "metrics", + "metrics 0.23.0", "once_cell", "parking_lot", "restate-core", @@ -5988,7 +6038,7 @@ dependencies = [ "aws-sdk-lambda", "aws-sdk-sts", "aws-smithy-runtime", - "base64 0.21.7", + "base64 0.22.0", "bs58", "bytestring", "derive_builder", @@ -6016,16 +6066,16 @@ dependencies = [ name = "restate-service-protocol" version = "1.1.0" dependencies = [ - "base64 0.21.7", + "base64 0.22.0", "bytes", "bytes-utils", "codederror", "hyper 0.14.28", - "itertools 0.11.0", + "itertools 0.13.0", "once_cell", "paste", "prost", - "regress 0.9.1", + "regress 0.10.0", "restate-base64-util", "restate-errors", "restate-service-client", @@ -6173,7 +6223,7 @@ version = "1.1.0" dependencies = [ "console-subscriber", "derive_builder", - "metrics-tracing-context", + "metrics-tracing-context 0.15.0", "nu-ansi-term", "once_cell", "opentelemetry", @@ -6198,7 +6248,7 @@ dependencies = [ "anyhow", "arc-swap", "base62", - "base64 0.21.7", + "base64 0.22.0", "bytes", "bytestring", "clap", @@ -6211,7 +6261,7 @@ dependencies = [ "hostname", "http 0.2.12", "humantime", - "itertools 0.11.0", + "itertools 0.13.0", "jsonptr", "num-traits", "once_cell", @@ -6222,7 +6272,7 @@ dependencies = [ "prost-dto", "prost-types", "rand", - "regress 0.9.1", + "regress 0.10.0", "restate-base64-util", "restate-serde-util", "restate-test-util", @@ -6234,7 +6284,7 @@ dependencies = [ "strum 0.26.2", "strum_macros 0.26.2", "syn 2.0.65", - "sync_wrapper", + "sync_wrapper 1.0.1", "tempfile", "test-log", "thiserror", @@ -6243,7 +6293,7 @@ dependencies = [ "toml", "tracing", "tracing-opentelemetry", - "typify 0.0.16", + "typify", "ulid", "xxhash-rust", ] @@ -6296,7 +6346,7 @@ dependencies = [ "futures", "googletest", "humantime", - "metrics", + "metrics 0.23.0", "opentelemetry", "pin-project", "prost", @@ -6403,7 +6453,7 @@ dependencies = [ [[package]] name = "rocksdb" version = "0.22.0" -source = "git+https://github.com/restatedev/rust-rocksdb?rev=64a3c698910380e4fcbd8e56ce459779932cf1ff#64a3c698910380e4fcbd8e56ce459779932cf1ff" +source = "git+https://github.com/restatedev/rust-rocksdb?rev=c7ccbbcd261bdec011c4976c441676512a1a4841#c7ccbbcd261bdec011c4976c441676512a1a4841" dependencies = [ "libc", "librocksdb-sys", @@ -6728,15 +6778,17 @@ dependencies = [ [[package]] name = "serde_with" -version = "2.3.3" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" dependencies = [ - "base64 0.13.1", + "base64 0.22.0", "chrono", "hex", "indexmap 1.9.3", + "indexmap 2.2.6", "serde", + "serde_derive", "serde_json", "serde_with_macros", "time", @@ -6744,9 +6796,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "2.3.3" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" dependencies = [ "darling 0.20.8", "proc-macro2", @@ -7102,6 +7154,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + [[package]] name = "synstructure" version = "0.12.6" @@ -7789,42 +7847,14 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "typify" -version = "0.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c61e9db210bbff218e6535c664b37ec47da449169b98e7866d0580d0db75529" -dependencies = [ - "typify-impl 0.0.16", - "typify-macro 0.0.16", -] - [[package]] name = "typify" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb6beec125971dda80a086f90b4a70f60f222990ce4d63ad0fc140492f53444" dependencies = [ - "typify-impl 0.1.0", - "typify-macro 0.1.0", -] - -[[package]] -name = "typify-impl" -version = "0.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95e32f38493804f88e2dc7a5412eccd872ea5452b4db9b0a77de4df180f2a87e" -dependencies = [ - "heck 0.4.1", - "log", - "proc-macro2", - "quote", - "regress 0.8.0", - "schemars", - "serde_json", - "syn 2.0.65", - "thiserror", - "unicode-ident", + "typify-impl", + "typify-macro", ] [[package]] @@ -7847,22 +7877,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "typify-macro" -version = "0.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc09508b72f63d521d68e42c7f172c7416d67986df44b3c7d1f7f9963948ed32" -dependencies = [ - "proc-macro2", - "quote", - "schemars", - "serde", - "serde_json", - "serde_tokenstream", - "syn 2.0.65", - "typify-impl 0.0.16", -] - [[package]] name = "typify-macro" version = "0.1.0" @@ -7877,7 +7891,7 @@ dependencies = [ "serde_json", "serde_tokenstream", "syn 2.0.65", - "typify-impl 0.1.0", + "typify-impl", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 26726d1ad9..6abac6199e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,7 +77,7 @@ assert2 = "0.3.11" async-channel = "2.1.1" async-trait = "0.1.73" axum = { version = "0.6.18", default-features = false } -base64 = "0.21" +base64 = "0.22" bytes = { version = "1.3", features = ["serde"] } bytes-utils = "0.1.3" bytestring = { version = "1.2", features = ["serde"] } @@ -92,8 +92,8 @@ crossterm = { version = "0.27.0" } dashmap = { version = "5.5.3" } datafusion = { version = "35.0.0" } datafusion-expr = { version = "35.0.0" } -derive-getters = { version = "0.3.0" } -derive_builder = "0.12.0" +derive-getters = { version = "0.4.0" } +derive_builder = "0.20.0" derive_more = { version = "0.99.17" } dialoguer = { version = "0.11.0" } enum-map = { version = "2.7.3" } @@ -108,9 +108,9 @@ http = "0.2.9" humantime = "2.1.0" hyper = { version = "0.14.24", default-features = false } hyper-rustls = { version = "0.24.1", features = ["http2"] } -itertools = "0.11.0" -metrics = { version = "0.22" } -metrics-exporter-prometheus = { version = "0.14", default-features = false, features = ["async-runtime"] } +itertools = "0.13.0" +metrics = { version = "0.23" } +metrics-exporter-prometheus = { version = "0.15", default-features = false, features = ["async-runtime"] } once_cell = "1.18" opentelemetry = { version = "0.22.0" } opentelemetry-http = { version = "0.11.1" } @@ -124,20 +124,21 @@ prost-dto = { version = "0.0.2" } prost-types = "0.12.1" rand = "0.8.5" rayon = { version = "1.10" } +regress = { version = "0.10" } rlimit = { version = "0.10.1" } -rocksdb = { version = "0.22.0", features = ["multi-threaded-cf"], git = "https://github.com/restatedev/rust-rocksdb", rev="64a3c698910380e4fcbd8e56ce459779932cf1ff" } +rocksdb = { version = "0.22.0", features = ["multi-threaded-cf"], git = "https://github.com/restatedev/rust-rocksdb", rev="c7ccbbcd261bdec011c4976c441676512a1a4841" } rustls = "0.21.6" schemars = { version = "0.8", features = ["bytes", "enumset"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -serde_with = "2.2" +serde_with = "3.8" serde_yaml = "0.9" sha2 = "0.10.8" smartstring = { version = "1.0.1" } static_assertions = { version = "1.1.0" } strum = { version = "0.26.1" } strum_macros = { version = "0.26.1" } -sync_wrapper = "0.1.2" +sync_wrapper = "1.0.1" smallvec = { version = "1.13.2", features = ["serde"] } tempfile = "3.6.0" test-log = { version = "0.2.11", default-features = false, features = ["trace"] } diff --git a/cli/src/clients/cloud/mod.rs b/cli/src/clients/cloud/mod.rs index 7fbc318a90..63e7bed877 100644 --- a/cli/src/clients/cloud/mod.rs +++ b/cli/src/clients/cloud/mod.rs @@ -15,6 +15,9 @@ pub use self::client::CloudClient; pub use self::interface::CloudClientInterface; pub mod generated { + #![allow(clippy::to_string_trait_impl)] + use serde::{Deserialize, Serialize}; + typify::import_types!(schema = "src/clients/cloud/schema.json"); } diff --git a/cli/src/clients/datafusion_helpers.rs b/cli/src/clients/datafusion_helpers.rs index 0354123ac6..3c68dcaf47 100644 --- a/cli/src/clients/datafusion_helpers.rs +++ b/cli/src/clients/datafusion_helpers.rs @@ -275,12 +275,6 @@ pub async fn find_active_invocations_simple( Ok(rows) } -#[derive(Debug, Clone)] -pub struct InvocationDetailed { - pub invocation: Invocation, - pub journal: Vec, -} - #[derive(Debug, Clone)] pub struct Invocation { pub id: String, @@ -296,7 +290,6 @@ pub struct Invocation { // If it **requires** this deployment. pub pinned_deployment_id: Option, pub pinned_deployment_exists: bool, - pub deployment_id_at_latest_svc_revision: String, // Last attempted deployment pub last_attempt_deployment_id: Option, pub last_attempt_server: Option, @@ -557,7 +550,6 @@ pub struct ServiceHandlerLockedKeysMap { #[derive(Clone, Default, Debug)] pub struct LockedKeyInfo { pub num_pending: i64, - pub oldest_pending: Option>, // Who is holding the lock pub invocation_holding_lock: Option, pub invocation_method_holding_lock: Option, @@ -631,11 +623,9 @@ pub async fn get_locked_keys_status( let service = batch.column(0).as_string::().value(i); let key = value_as_string(&batch, 1, i); let num_pending = value_as_i64(&batch, 2, i); - let oldest_pending = value_as_dt_opt(&batch, 3, i); let info = LockedKeyInfo { num_pending, - oldest_pending, ..LockedKeyInfo::default() }; key_map.insert(service, key, info); @@ -854,9 +844,6 @@ pub async fn find_active_invocations( next_retry_at: row.next_retry_at.map(Into::into), pinned_deployment_id: row.pinned_deployment_id, pinned_deployment_exists: row.known_deployment_id.is_some(), - deployment_id_at_latest_svc_revision: row - .comp_latest_deployment - .expect("comp_latest_deployment"), last_failure_message: row.last_failure, last_failure_entry_index: row.last_failure_related_entry_index, last_failure_entry_name: row.last_failure_related_entry_name, diff --git a/crates/codederror/derive/src/attr.rs b/crates/codederror/derive/src/attr.rs index de7cf2ea12..2dd1b9cb50 100644 --- a/crates/codederror/derive/src/attr.rs +++ b/crates/codederror/derive/src/attr.rs @@ -52,11 +52,11 @@ impl<'a> Attrs<'a> { } } -#[derive(Copy, Clone)] -pub struct Error<'a> { - pub original: &'a Attribute, - pub is_transparent: bool, -} +// #[derive(Copy, Clone)] +// pub struct Error<'a> { +// pub original: &'a Attribute, +// pub is_transparent: bool, +// } #[derive(Clone)] pub struct Code<'a> { diff --git a/crates/node/Cargo.toml b/crates/node/Cargo.toml index 2a0eb611bf..038a8a962c 100644 --- a/crates/node/Cargo.toml +++ b/crates/node/Cargo.toml @@ -46,8 +46,8 @@ humantime = { workspace = true } hyper = { workspace = true, features = ["full"] } metrics = { workspace = true } metrics-exporter-prometheus = { workspace = true } -metrics-tracing-context = { version = "0.15.0" } -metrics-util = { version = "0.16.0" } +metrics-tracing-context = { version = "0.16.0" } +metrics-util = { version = "0.17.0" } once_cell = { workspace = true } prost-types = { workspace = true } rocksdb = { workspace = true } diff --git a/crates/node/src/cluster_marker.rs b/crates/node/src/cluster_marker.rs index 41cad835bc..087317947b 100644 --- a/crates/node/src/cluster_marker.rs +++ b/crates/node/src/cluster_marker.rs @@ -209,6 +209,7 @@ fn validate_and_update_cluster_marker_inner( // write the new cluster marker file let new_cluster_marker_file = OpenOptions::new() .create(true) + .truncate(true) .write(true) .open(tmp_cluster_marker_filepath.as_path()) .map_err(ClusterValidationError::CreateFile)?; @@ -247,7 +248,11 @@ mod tests { cluster_marker: &ClusterMarker, path: impl AsRef, ) -> anyhow::Result<()> { - let file = OpenOptions::new().create(true).write(true).open(path)?; + let file = OpenOptions::new() + .create(true) + .truncate(true) + .write(true) + .open(path)?; serde_json::to_writer(&file, cluster_marker)?; Ok(()) } diff --git a/crates/node/src/lib.rs b/crates/node/src/lib.rs index aec5866e75..abb78c3940 100644 --- a/crates/node/src/lib.rs +++ b/crates/node/src/lib.rs @@ -177,12 +177,9 @@ impl Node { let server = NetworkServer::new( networking.connection_manager(), - worker_role.as_ref().map(|worker| { - WorkerDependencies::new( - worker.storage_query_context().clone(), - worker.subscription_controller(), - ) - }), + worker_role + .as_ref() + .map(|worker| WorkerDependencies::new(worker.storage_query_context().clone())), admin_role.as_ref().map(|cluster_controller| { AdminDependencies::new( cluster_controller.cluster_controller_handle(), diff --git a/crates/node/src/network_server/metrics.rs b/crates/node/src/network_server/metrics.rs index 41d510bb61..0447548260 100644 --- a/crates/node/src/network_server/metrics.rs +++ b/crates/node/src/network_server/metrics.rs @@ -10,7 +10,8 @@ use metrics_exporter_prometheus::{PrometheusBuilder, PrometheusHandle}; use metrics_tracing_context::TracingContextLayer; -use metrics_util::{layers::Layer, MetricKindMask}; +use metrics_util::layers::Layer; +use metrics_util::MetricKindMask; use restate_types::config::CommonOptions; diff --git a/crates/node/src/network_server/service.rs b/crates/node/src/network_server/service.rs index d319aad968..e6ca31ef1f 100644 --- a/crates/node/src/network_server/service.rs +++ b/crates/node/src/network_server/service.rs @@ -21,7 +21,6 @@ use restate_core::{cancellation_watcher, task_center}; use restate_metadata_store::MetadataStoreClient; use restate_storage_query_datafusion::context::QueryContext; use restate_types::config::CommonOptions; -use restate_worker::SubscriptionControllerHandle; use crate::network_server::handler; use crate::network_server::handler::cluster_ctrl::ClusterCtrlSvcHandler; @@ -132,18 +131,11 @@ async fn handler_404() -> (http::StatusCode, &'static str) { pub struct WorkerDependencies { pub query_context: QueryContext, - pub subscription_controller: Option, } impl WorkerDependencies { - pub fn new( - query_context: QueryContext, - subscription_controller: Option, - ) -> Self { - WorkerDependencies { - query_context, - subscription_controller, - } + pub fn new(query_context: QueryContext) -> Self { + WorkerDependencies { query_context } } } diff --git a/crates/node/src/roles/worker.rs b/crates/node/src/roles/worker.rs index 88108db3cb..27d43b6f5b 100644 --- a/crates/node/src/roles/worker.rs +++ b/crates/node/src/roles/worker.rs @@ -22,7 +22,7 @@ use restate_types::schema::subscriptions::SubscriptionResolver; use restate_types::schema::UpdateableSchema; use restate_types::Version; use restate_worker::SubscriptionController; -use restate_worker::{SubscriptionControllerHandle, Worker}; +use restate_worker::Worker; #[derive(Debug, thiserror::Error, CodedError)] pub enum WorkerRoleError { @@ -89,10 +89,6 @@ impl WorkerRole { self.worker.storage_query_context() } - pub fn subscription_controller(&self) -> Option { - Some(self.worker.subscription_controller_handle()) - } - pub async fn start(self) -> anyhow::Result<()> { let tc = task_center(); // todo: only run subscriptions on node 0 once being distributed diff --git a/crates/partition-store/src/partition_store_manager.rs b/crates/partition-store/src/partition_store_manager.rs index 270ec1a57f..eb05a1b8f1 100644 --- a/crates/partition-store/src/partition_store_manager.rs +++ b/crates/partition-store/src/partition_store_manager.rs @@ -87,7 +87,7 @@ impl PartitionStoreManager { pub async fn has_partition(&self, partition_id: PartitionId) -> bool { let guard = self.lookup.lock().await; - guard.live.get(&partition_id).is_some() + guard.live.contains_key(&partition_id) } pub async fn get_partition_store(&self, partition_id: PartitionId) -> Option { diff --git a/crates/service-protocol/Cargo.toml b/crates/service-protocol/Cargo.toml index 1c1cb8dd22..38f66daf95 100644 --- a/crates/service-protocol/Cargo.toml +++ b/crates/service-protocol/Cargo.toml @@ -31,7 +31,7 @@ itertools = { workspace = true } once_cell = { workspace = true } paste = { workspace = true, optional = true } prost = { workspace = true } -regress = { version = "0.9", optional = true } +regress = { workspace = true, optional = true } serde = { workspace = true, optional = true } serde_json = { workspace = true, optional = true } size = { version = "0.4.1", optional = true } diff --git a/crates/storage-query-datafusion/src/mocks.rs b/crates/storage-query-datafusion/src/mocks.rs index b5e197dc35..d676f94ecd 100644 --- a/crates/storage-query-datafusion/src/mocks.rs +++ b/crates/storage-query-datafusion/src/mocks.rs @@ -90,6 +90,7 @@ impl SelectPartitions for MockPartitionSelector { } } +#[allow(dead_code)] pub(crate) struct MockQueryEngine(PartitionStoreManager, PartitionStore, QueryContext); impl MockQueryEngine { diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml index f979c42e24..9d0f738285 100644 --- a/crates/types/Cargo.toml +++ b/crates/types/Cargo.toml @@ -41,7 +41,7 @@ prost = { workspace = true } prost-dto = { workspace = true } prost-types = { workspace = true } rand = { workspace = true } -regress = { version = "0.9" } +regress = { workspace = true } schemars = { workspace = true, optional = true } serde = { workspace = true, features = ["rc"] } serde_json = { workspace = true } @@ -75,5 +75,5 @@ prettyplease = "0.2" schemars = { workspace = true } serde_json = { workspace = true } syn = "2.0" -typify = { version = "0.0.16" } +typify = { version = "0.1.0" } jsonptr = "0.4.7" diff --git a/crates/types/src/endpoint_manifest.rs b/crates/types/src/endpoint_manifest.rs index 68a983c0c1..dd5e433a89 100644 --- a/crates/types/src/endpoint_manifest.rs +++ b/crates/types/src/endpoint_manifest.rs @@ -10,6 +10,7 @@ mod generated { #![allow(clippy::clone_on_copy)] + #![allow(clippy::to_string_trait_impl)] include!(concat!(env!("OUT_DIR"), "/endpoint_manifest.rs")); } diff --git a/crates/worker/src/partition/shuffle.rs b/crates/worker/src/partition/shuffle.rs index 584a0605f2..e87282293d 100644 --- a/crates/worker/src/partition/shuffle.rs +++ b/crates/worker/src/partition/shuffle.rs @@ -19,7 +19,7 @@ use restate_core::cancellation_watcher; use restate_storage_api::deduplication_table::DedupInformation; use restate_storage_api::outbox_table::OutboxMessage; use restate_types::identifiers::{LeaderEpoch, PartitionId, PartitionKey, WithPartitionKey}; -use restate_types::message::{AckKind, MessageIndex}; +use restate_types::message::MessageIndex; use restate_types::NodeId; use restate_wal_protocol::{append_envelope_to_bifrost, Destination, Envelope, Header, Source}; @@ -54,9 +54,6 @@ impl OutboxTruncation { } } -#[derive(Debug, Clone)] -pub(crate) struct ShuffleInput(pub(crate) AckKind); - pub(crate) fn wrap_outbox_message_in_envelope( message: OutboxMessage, seq_number: MessageIndex, @@ -101,11 +98,6 @@ pub(super) trait OutboxReader { &mut self, next_sequence_number: MessageIndex, ) -> impl Future, OutboxReaderError>> + Send; - - fn get_message( - &mut self, - next_sequence_number: MessageIndex, - ) -> impl Future, OutboxReaderError>> + Send; } /// The hint sender allows to send hints to the shuffle service. If more hints are sent than the @@ -516,20 +508,6 @@ mod tests { ) })) } - - async fn get_message( - &mut self, - next_sequence_number: MessageIndex, - ) -> Result, OutboxReaderError> { - Ok(self - .subslice_from_index(next_sequence_number) - .first() - .and_then(|x| { - x.clone().map(|service_invocation| { - OutboxMessage::ServiceInvocation(service_invocation) - }) - })) - } } /// Outbox reader which is used to let the shuffler fail in a controlled manner so that we @@ -580,22 +558,6 @@ mod tests { ) })) } - - async fn get_message( - &mut self, - next_sequence_number: MessageIndex, - ) -> Result, OutboxReaderError> { - self.check_fail(next_sequence_number)?; - - Ok(self - .records - .get(next_sequence_number as usize) - .and_then(|msg| { - msg.clone().map(|service_invocation| { - OutboxMessage::ServiceInvocation(service_invocation) - }) - })) - } } async fn collect_invoke_commands_until( diff --git a/crates/worker/src/partition/storage/mod.rs b/crates/worker/src/partition/storage/mod.rs index dca8d6d1aa..73128cc9f4 100644 --- a/crates/worker/src/partition/storage/mod.rs +++ b/crates/worker/src/partition/storage/mod.rs @@ -727,18 +727,6 @@ where Ok(result) } - - async fn get_message( - &mut self, - sequence_number: MessageIndex, - ) -> Result, OutboxReaderError> { - let partition_id = self.partition_id; - - self.storage - .get_outbox_message(partition_id, sequence_number) - .await - .map_err(OutboxReaderError::Storage) - } } impl TimerReader for PartitionStorage diff --git a/deny.toml b/deny.toml index 9414578a72..220b01dafd 100644 --- a/deny.toml +++ b/deny.toml @@ -1,14 +1,12 @@ [advisories] db-path = "~/.cargo/advisory-db" db-urls = ["https://github.com/rustsec/advisory-db"] -vulnerability = "deny" -unmaintained = "warn" +# https://github.com/EmbarkStudios/cargo-deny/pull/611 +version = 2 yanked = "deny" -notice = "warn" [licenses] -unlicensed = "deny" allow = [ "MIT", "Apache-2.0", @@ -20,11 +18,6 @@ allow = [ "MPL-2.0", "CC0-1.0", ] -deny = [] -# Lint level for licenses considered copyleft -copyleft = "deny" -allow-osi-fsf-free = "neither" -default = "deny" # The confidence threshold for detecting a license from license text. # The higher the value, the more closely the license text must be to the # canonical license text of a valid SPDX license file. @@ -176,7 +169,7 @@ unknown-registry = "deny" unknown-git = "deny" allow-registry = ["https://github.com/rust-lang/crates.io-index"] allow-git = [ - "https://github.com/rust-rocksdb/rust-rocksdb.git", + "https://github.com/restatedev/rust-rocksdb.git", ] [sources.allow-org] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index d561231b92..82eda2fce9 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.75.0" +channel = "1.79.0" profile = "minimal" -components = ["rustfmt", "clippy"] \ No newline at end of file +components = ["rustfmt", "clippy"] diff --git a/server/src/future_util.rs b/server/src/future_util.rs deleted file mode 100644 index 15ae9d7c20..0000000000 --- a/server/src/future_util.rs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2023 - Restate Software, Inc., Restate GmbH. -// All rights reserved. -// -// Use of this software is governed by the Business Source License -// included in the LICENSE file. -// -// As of the Change Date specified in that file, in accordance with -// the Business Source License, use of this software will be governed -// by the Apache License, Version 2.0. - -use futures_util::TryFuture; -use pin_project::pin_project; -use std::fmt::Debug; -use std::future::Future; -use std::pin::Pin; -use std::process; -use std::task::{Context, Poll}; -use tracing::error; - -pub(crate) trait TryProcessAbortFuture: TryFuture { - /// Aborts the process if the future completes with an error. - fn abort_on_err(self, component: Option) -> AbortOnErr - where - Self: Sized, - T: AsRef, - { - AbortOnErr { - inner: self, - component, - } - } -} - -#[derive(Debug)] -#[must_use = "futures do nothing unless you `.await` or poll them"] -#[pin_project] -pub(crate) struct AbortOnErr { - #[pin] - inner: Fut, - component: Option, -} - -impl Future for AbortOnErr -where - Fut: TryFuture, - ::Error: Debug, - T: AsRef, -{ - type Output = Fut::Ok; - - fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - let this = self.project(); - - if let Poll::Ready(result) = this.inner.try_poll(cx) { - match result { - Ok(ok) => Poll::Ready(ok), - Err(err) => { - let component = this - .component - .as_ref() - .map_or("Unknown component", |x| x.as_ref()); - error!(error = ?err, "{component} failed"); - process::abort(); - } - } - } else { - Poll::Pending - } - } -} - -impl TryProcessAbortFuture for Fut {} diff --git a/server/src/lib.rs b/server/src/lib.rs index 8ab34d60ab..1c23bd651e 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -10,4 +10,3 @@ pub mod build_info; pub mod config_loader; -pub mod future_util;