diff --git a/Cargo.lock b/Cargo.lock index d2f4d4343..1505f2528 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -277,7 +277,7 @@ dependencies = [ "miniz_oxide", "num-bigint", "quad-rand", - "rand 0.9.4", + "rand 0.9.5", "regex-lite", "serde", "serde_bytes", @@ -877,7 +877,7 @@ dependencies = [ "fastrand", "hex", "http 1.4.2", - "sha1 0.10.6", + "sha1 0.10.7", "time", "tokio", "tracing", @@ -1780,9 +1780,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.66" +version = "1.2.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5d6cac793997bd970000024b2934968efe83b382de4fdcf4fcb46b6ee4ad996" +checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38" dependencies = [ "find-msvc-tools", "jobserver", @@ -2781,7 +2781,7 @@ dependencies = [ "log", "object_store", "parking_lot", - "rand 0.9.4", + "rand 0.9.5", "tokio", "tokio-util", "url", @@ -2907,7 +2907,7 @@ dependencies = [ "log", "object_store", "parking_lot", - "rand 0.9.4", + "rand 0.9.5", "tempfile", "url", ] @@ -2970,7 +2970,7 @@ dependencies = [ "md-5 0.11.0", "memchr", "num-traits", - "rand 0.9.4", + "rand 0.9.5", "regex", "sha2 0.11.0", "uuid", @@ -3632,7 +3632,7 @@ dependencies = [ "libc", "option-ext", "redox_users 0.5.2", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -3966,7 +3966,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -4284,9 +4284,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "1.4.3" +version = "1.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e55f16dcf0e9c00efbe2e655ffe45fc98e7066b52bc92f8a79e64060a79351" +checksum = "ab4e5aa225bc56696909483320f0ff9b600f1a971b52e07a17d70f3d9b43254b" dependencies = [ "generic-array 0.14.9", "rustversion", @@ -4744,7 +4744,7 @@ dependencies = [ "http 1.4.2", "httpdate", "mime", - "sha1 0.10.6", + "sha1 0.10.7", ] [[package]] @@ -4925,9 +4925,9 @@ dependencies = [ [[package]] name = "hotpath" -version = "0.21.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ff6b552a6afa29d9e33f8d555bee9093c142dd449501ae128e6494a303f03dc" +checksum = "0772e97af6db4889a5894b3eddb7d6b8a75819fdf03fe89a07185ce651c66c85" dependencies = [ "arc-swap", "cfg-if", @@ -4947,9 +4947,9 @@ dependencies = [ [[package]] name = "hotpath-macros" -version = "0.21.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f15322569d3cfadf84c0de7ef72be435b8f4b4839ee4ace78a7eaca48a87ded" +checksum = "be1a3963a08af931247e0a560a8afd922d4a9f34b97be61306d286953e56fb96" dependencies = [ "proc-macro2", "quote", @@ -5376,7 +5376,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -6096,7 +6096,7 @@ dependencies = [ "ordered-float 5.3.0", "quanta", "radix_trie", - "rand 0.9.4", + "rand 0.9.5", "rand_xoshiro", "rapidhash", "sketches-ddsketch", @@ -6175,7 +6175,7 @@ dependencies = [ "metrique-core", "metrique-writer-core", "metrique-writer-macro", - "rand 0.9.4", + "rand 0.9.5", "smallvec", "tokio", "tracing", @@ -6406,7 +6406,7 @@ dependencies = [ "saturating", "serde", "serde_json", - "sha1 0.10.6", + "sha1 0.10.7", "sha2 0.10.9", "thiserror 2.0.18", "uuid", @@ -6514,7 +6514,7 @@ dependencies = [ "ed25519-dalek 2.2.0", "getrandom 0.2.17", "log", - "rand 0.8.6", + "rand 0.8.7", "signatory", ] @@ -6561,7 +6561,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -6570,7 +6570,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc895af95856f929163a0aa20c26a78d26bfdc839f51b9d5aa7a5b79e52b7e83" dependencies = [ - "rand 0.8.6", + "rand 0.8.7", ] [[package]] @@ -6595,7 +6595,7 @@ dependencies = [ "num-integer", "num-iter", "num-traits", - "rand 0.8.6", + "rand 0.8.7", "smallvec", "zeroize", ] @@ -6698,11 +6698,11 @@ version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51e219e79014df21a225b1860a479e2dcd7cbd9130f4defd4bd0e191ea31d67d" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "chrono", "getrandom 0.2.17", "http 1.4.2", - "rand 0.8.6", + "rand 0.8.7", "serde", "serde_json", "serde_path_to_error", @@ -6871,7 +6871,7 @@ dependencies = [ "oauth2", "p256 0.13.2", "p384 0.13.1", - "rand 0.8.6", + "rand 0.8.7", "rsa 0.9.10", "serde", "serde-value", @@ -6988,7 +6988,7 @@ dependencies = [ "opentelemetry", "percent-encoding", "portable-atomic", - "rand 0.9.4", + "rand 0.9.5", "thiserror 2.0.18", "tokio", "tokio-stream", @@ -7041,7 +7041,7 @@ dependencies = [ "pkcs5 0.7.1", "rand 0.10.2", "rc2", - "sha1 0.10.6", + "sha1 0.10.7", "sha2 0.10.9", "thiserror 2.0.18", "x509-parser", @@ -7224,9 +7224,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "path-absolutize" -version = "3.1.1" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4af381fe79fa195b4909485d99f73a80792331df0625188e707854f0b3383f5" +checksum = "f808742975794703469f67a28dd14b1d1009a1743c18b0353b4b951dbb0068ad" dependencies = [ "path-dedot", ] @@ -7239,12 +7239,9 @@ checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" [[package]] name = "path-dedot" -version = "3.1.1" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ba0ad7e047712414213ff67533e6dd477af0a4e1d14fb52343e53d30ea9397" -dependencies = [ - "once_cell", -] +checksum = "03351d0f1c066c114015408dc6a3e101f080fc03ef9d8d799aa58ec760cac5a6" [[package]] name = "pbkdf2" @@ -7552,9 +7549,9 @@ dependencies = [ [[package]] name = "pollster" -version = "0.4.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3" +checksum = "bc6355899e1c9462875b6757c79f3caa011a1fdae12bbb1a2e72dd1f234f8336" [[package]] name = "poly1305" @@ -7569,9 +7566,9 @@ dependencies = [ [[package]] name = "polyval" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfc63250416fea14f5749b90725916a6c903f599d51cb635aa7a52bfd03eede" +checksum = "b20f20e954175de5f463f67781b35583397d916b1d148738923711b2ad16bee8" dependencies = [ "cpubits", "cpufeatures 0.3.0", @@ -7787,7 +7784,7 @@ dependencies = [ "bit-vec 0.8.0", "bitflags 2.13.0", "num-traits", - "rand 0.9.4", + "rand 0.9.5", "rand_chacha 0.9.0", "rand_xorshift", "regex-syntax", @@ -7823,7 +7820,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" dependencies = [ "heck", - "itertools 0.10.5", + "itertools 0.14.0", "log", "multimap", "once_cell", @@ -7843,7 +7840,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042" dependencies = [ "heck", - "itertools 0.10.5", + "itertools 0.14.0", "log", "multimap", "petgraph 0.8.3", @@ -7864,7 +7861,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.14.0", "proc-macro2", "quote", "syn 2.0.118", @@ -7877,7 +7874,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.14.0", "proc-macro2", "quote", "syn 2.0.118", @@ -7960,7 +7957,7 @@ dependencies = [ "prost 0.13.5", "prost-build 0.13.5", "prost-derive 0.13.5", - "rand 0.8.6", + "rand 0.8.7", "regex", "rustls", "tokio", @@ -8094,7 +8091,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -8130,9 +8127,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" +checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" dependencies = [ "libc", "rand_chacha 0.3.1", @@ -8141,9 +8138,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.5", @@ -8700,7 +8697,7 @@ dependencies = [ "enum_dispatch", "flate2", "futures", - "generic-array 1.4.3", + "generic-array 1.4.4", "getrandom 0.4.3", "ghash", "hex-literal", @@ -10163,7 +10160,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -10237,7 +10234,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -10691,9 +10688,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" dependencies = [ "cfg-if", "cpufeatures 0.2.17", @@ -11401,7 +11398,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix 1.1.4", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -11499,9 +11496,9 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" dependencies = [ "cfg-if", ] @@ -11582,9 +11579,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" dependencies = [ "tinyvec_macros", ] @@ -11744,7 +11741,7 @@ dependencies = [ "futures-sink", "http 1.4.2", "httparse", - "rand 0.8.6", + "rand 0.8.7", "ring", "rustls-pki-types", "tokio", @@ -12078,10 +12075,10 @@ dependencies = [ "http 1.4.2", "httparse", "log", - "rand 0.9.4", + "rand 0.9.5", "rustls", "rustls-pki-types", - "sha1 0.10.6", + "sha1 0.10.7", "thiserror 2.0.18", ] @@ -12237,9 +12234,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.23.4" +version = "1.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf80a72845275afea99e7f2b434723d3bc7e38470fcd1c7ed39a599c73319a53" +checksum = "ea5fab0d6c3c01ae70085a09cb03d4c7a1d6314e2b3e075392783396d724ca0a" dependencies = [ "getrandom 0.4.3", "js-sys", @@ -12502,7 +12499,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -13011,9 +13008,9 @@ checksum = "b142a20ec14a91d5bc708c1dc21b080c550113d8aa77afa29635673a65dd02c5" [[package]] name = "zmij" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" +checksum = "bd2f034a4bebf216c9e4b7083603e024cf930873fd67830cfb083c9fa33129d9" [[package]] name = "zopfli" diff --git a/Cargo.toml b/Cargo.toml index 2cbe14834..1c9ca85bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -142,7 +142,7 @@ futures = "0.3.32" futures-core = "0.3.32" futures-lite = "2.6.1" futures-util = "0.3.32" -pollster = "0.4.0" +pollster = "1.0.1" pulsar = { version = "6.8.0", default-features = false, features = ["tokio-rustls-runtime", "telemetry"] } lapin = { version = "4.10.0", default-features = false, features = ["tokio", "rustls", "rustls--aws_lc_rs"] } hyper = { version = "1.10.1", features = ["http2", "http1", "server"] } @@ -266,7 +266,7 @@ netif = "0.1.6" num_cpus = { version = "1.17.0" } nvml-wrapper = "0.12.1" parking_lot = "0.12.5" -path-absolutize = "3.1.1" +path-absolutize = "4.0.1" path-clean = "1.0.1" percent-encoding = "2.3.2" pin-project-lite = "0.2.17" @@ -305,7 +305,7 @@ tracing-subscriber = { version = "0.3.23", features = ["env-filter", "time"] } transform-stream = "0.3.1" url = "2.5.8" urlencoding = "2.1.3" -uuid = { version = "1.23.4", features = ["v4", "fast-rng", "macro-diagnostics"] } +uuid = { version = "1.23.5", features = ["v4", "fast-rng", "macro-diagnostics"] } vaultrs = { version = "0.8.0" } walkdir = "2.5.0" windows = { version = "0.62.2" } diff --git a/crates/object-data-cache/src/moka_backend.rs b/crates/object-data-cache/src/moka_backend.rs index 872cb6a90..6b4a1b757 100644 --- a/crates/object-data-cache/src/moka_backend.rs +++ b/crates/object-data-cache/src/moka_backend.rs @@ -339,18 +339,27 @@ impl MokaBackend { } /// Drops every cached body and resets the identity index. The index scan - /// yields the tracked key count for the outcome label; `invalidate_all` - /// then clears moka in one call (also dropping any entry not tracked in the - /// index). Rare admin `clear()` path only. + /// yields the tracked key count for the outcome label, then the cache is + /// drained explicitly so even a body that is no longer tracked by the + /// index cannot survive the clear path. Rare admin `clear()` path only. pub async fn clear(&self) -> ObjectDataCacheInvalidationResult { - let removed = self.index.remove_matching(|_| true).await.len(); - self.cache.invalidate_all(); - // Moka processes invalidations lazily. A single run_pending_tasks() may - // not evict all entries if concurrent fill tasks recently committed - // writes. Drain in a loop until the entry count reaches zero, yielding - // between rounds so the runtime can schedule moka's maintenance. + let keys_to_remove = self.index.remove_matching(|_| true).await; + let removed = keys_to_remove.len(); + for key in keys_to_remove { + self.cache.remove(&key).await; + } + + // Moka maintenance is still needed to retire queued removals, but clear + // must not rely on lazy invalidation alone: under heavy contention an + // entry can remain physically resident (and still counted) even though + // the invalidation fence already hides it from lookups. for _ in 0..256 { self.cache.run_pending_tasks().await; + let lingering_keys: Vec<_> = self.cache.iter().map(|(key, _)| key.as_ref().clone()).collect(); + for key in lingering_keys { + self.cache.remove(&key).await; + } + if self.cache.entry_count() == 0 { break; }