mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-18 10:43:15 +00:00
perf(ecstore): gate bounded GET metadata fanout (#5917)
Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -3834,18 +3834,19 @@ mod tests {
|
||||
assert!(metadata_early_stop_permitted(true, true, false, "", false, false));
|
||||
// observe=false (non-observed fanout) also disables early-stop.
|
||||
assert!(!metadata_early_stop_permitted(true, false, false, "", false, false));
|
||||
// Data reads are never eligible regardless of caller opt-in.
|
||||
// Data reads require their own explicit rollout gate.
|
||||
assert!(!metadata_early_stop_permitted(true, true, true, "", false, false));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn metadata_early_stop_rejects_data_reads() {
|
||||
fn metadata_early_stop_requires_explicit_data_read_opt_in() {
|
||||
temp_env::with_vars(
|
||||
[
|
||||
(ENV_RUSTFS_GET_METADATA_EARLY_STOP_ENABLE, Some("true")),
|
||||
(ENV_RUSTFS_GET_METADATA_VERSION_EARLY_STOP_ENABLE, Some("true")),
|
||||
(ENV_RUSTFS_GET_METADATA_DATA_READ_EARLY_STOP_ENABLE, None),
|
||||
],
|
||||
|| {
|
||||
assert!(!should_allow_metadata_early_stop(true, "", false, false));
|
||||
@@ -3854,6 +3855,17 @@ mod tests {
|
||||
assert!(should_allow_metadata_early_stop(false, "version-id", false, false));
|
||||
},
|
||||
);
|
||||
temp_env::with_vars(
|
||||
[
|
||||
(ENV_RUSTFS_GET_METADATA_EARLY_STOP_ENABLE, Some("true")),
|
||||
(ENV_RUSTFS_GET_METADATA_VERSION_EARLY_STOP_ENABLE, Some("true")),
|
||||
(ENV_RUSTFS_GET_METADATA_DATA_READ_EARLY_STOP_ENABLE, Some("true")),
|
||||
],
|
||||
|| {
|
||||
assert!(should_allow_metadata_early_stop(true, "", false, false));
|
||||
assert!(should_allow_metadata_early_stop(true, "version-id", false, false));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user