From 6f14a79089306ff78257ae8491d36caeec66a182 Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Mon, 24 Aug 2026 19:33:53 +0800 Subject: [PATCH] fix(quota): reconcile matching scanner usage (#6521) --- crates/ecstore/src/data_usage/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/ecstore/src/data_usage/mod.rs b/crates/ecstore/src/data_usage/mod.rs index c1db05676..ce320657b 100644 --- a/crates/ecstore/src/data_usage/mod.rs +++ b/crates/ecstore/src/data_usage/mod.rs @@ -2145,6 +2145,13 @@ async fn replace_bucket_usage_memory_from_info_if_generation(data_usage_info: &D candidate.insert(preserved); continue; } + if existing.authoritative && existing.dirty && bucket_usage_counts_match(&existing.usage, &candidate.get().usage) + { + // Matching core counts make the complete scanner snapshot + // equivalent for every field tracked by process-local + // mutations, even when its timestamp predates the request. + continue; + } if existing.authoritative && existing.usage_updated_at > usage_updated_at { candidate.insert(existing.clone()); continue;