fix(ecstore): hold read locks for streaming readers (#4195)

This commit is contained in:
cxymds
2026-07-02 22:36:12 +08:00
committed by GitHub
parent 91a02914cc
commit cf33bcc742
3 changed files with 137 additions and 36 deletions
+2 -3
View File
@@ -191,9 +191,8 @@ pub const DEFAULT_OBJECT_IO_BUFFER_SIZE: usize = 128 * 1024;
/// Environment variable to enable/disable lock optimization.
///
/// When enabled, read locks are released immediately after metadata
/// is read, rather than being held for the entire data transfer.
/// This significantly reduces lock contention under high concurrency.
/// When enabled, fully materialized reads may release read locks before the
/// reader is returned. Streaming reads keep the lock until EOF or drop.
///
/// Default: true (enabled, can be overridden by `RUSTFS_OBJECT_LOCK_OPTIMIZATION_ENABLE`).
pub const ENV_OBJECT_LOCK_OPTIMIZATION_ENABLE: &str = "RUSTFS_OBJECT_LOCK_OPTIMIZATION_ENABLE";