From b4b891afad61ce785aa17a46fe3715f954a68c62 Mon Sep 17 00:00:00 2001 From: houseme Date: Mon, 10 Aug 2026 02:34:27 +0800 Subject: [PATCH] fix(ecstore): raise replay cache auto headroom (#5902) Co-authored-by: heihutu --- crates/ecstore/src/cluster/rpc/http_auth.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/crates/ecstore/src/cluster/rpc/http_auth.rs b/crates/ecstore/src/cluster/rpc/http_auth.rs index eed40d141..8fa813c2d 100644 --- a/crates/ecstore/src/cluster/rpc/http_auth.rs +++ b/crates/ecstore/src/cluster/rpc/http_auth.rs @@ -84,7 +84,7 @@ const REPLAY_CACHE_RETENTION_SECS: usize = 601; const REPLAY_CACHE_ENTRY_BYTES_ESTIMATE: u64 = 128; const REPLAY_CACHE_AUTO_MEMORY_PERCENT: u64 = 8; const REPLAY_CACHE_AUTO_RPC_RPS_PER_CPU: usize = 2048; -const REPLAY_CACHE_AUTO_MAX_CAPACITY: usize = 16_777_216; +const REPLAY_CACHE_AUTO_MAX_CAPACITY: usize = 33_554_432; const NS_SCANNER_CAPABILITY_AUTH_DOMAIN: &[u8] = b"rustfs-ns-scanner-capability-v3"; pub const TONIC_RPC_PREFIX: &str = "/node_service.NodeService"; static INTERNODE_RPC_SIGNATURE_STRICT: LazyLock = LazyLock::new(|| { @@ -2505,7 +2505,7 @@ mod tests { } #[test] - fn replay_cache_capacity_auto_reaches_hotpath_verified_capacity_on_larger_nodes() { + fn replay_cache_capacity_auto_uses_resource_model_on_larger_nodes() { let gib = 1024_u64 * 1024 * 1024; let decision = replay_cache_capacity_decision(rustfs_utils::EnvParseOutcome::Absent, 16, Some(32 * gib), Some(MemoryBasis::Host)); @@ -2513,7 +2513,17 @@ mod tests { assert_eq!(decision.source, ReplayCacheCapacitySource::Auto); assert_eq!(decision.memory_based_capacity, 21_474_836); assert_eq!(decision.cpu_based_capacity, 19_693_568); - assert_eq!(decision.capacity, 16_777_216); + assert_eq!(decision.capacity, 19_693_568); + } + + #[test] + fn replay_cache_capacity_auto_caps_extreme_nodes() { + let gib = 1024_u64 * 1024 * 1024; + let decision = + replay_cache_capacity_decision(rustfs_utils::EnvParseOutcome::Absent, 128, Some(512 * gib), Some(MemoryBasis::Host)); + + assert_eq!(decision.source, ReplayCacheCapacitySource::Auto); + assert_eq!(decision.capacity, REPLAY_CACHE_AUTO_MAX_CAPACITY); } #[test]