fix(storage): cover inline reader fallback controls (#5169)

* test(ecstore): cover inline fast path boundaries

Co-Authored-By: heihutu <heihutu@gmail.com>

* fix(storage): cover inline reader fallback controls

Co-Authored-By: heihutu <heihutu@gmail.com>

* perf(tier): keep commit fanout concurrent

Co-Authored-By: heihutu <heihutu@gmail.com>

---------

Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
houseme
2026-07-24 14:08:17 +08:00
committed by GitHub
parent 6f6d8a4d3e
commit 4133fbe0fc
11 changed files with 1383 additions and 36 deletions
+44
View File
@@ -512,6 +512,50 @@ mod tests {
StorageClassEnvOverrides::default()
}
#[test]
fn should_inline_preserves_exact_default_shard_boundaries() {
let config = Config::default();
for (case, shard_size, versioned, expected) in [
("unversioned below", 128 * 1024 - 1, false, true),
("unversioned exact", 128 * 1024, false, true),
("unversioned above", 128 * 1024 + 1, false, false),
("versioned below", 16 * 1024 - 1, true, true),
("versioned exact", 16 * 1024, true, true),
("versioned above", 16 * 1024 + 1, true, false),
("negative", -1, false, false),
] {
assert_eq!(
config.should_inline(shard_size, versioned),
expected,
"{case}: shard_size={shard_size}, versioned={versioned}"
);
}
}
#[test]
fn should_inline_preserves_exact_default_ec_2_2_object_boundaries() {
let config = Config::default();
let erasure = crate::erasure::coding::Erasure::new(2, 2, 1024 * 1024);
for (case, object_size, versioned, expected_shard_size, expected) in [
("unversioned below", 256 * 1024 - 1, false, 128 * 1024, true),
("unversioned exact", 256 * 1024, false, 128 * 1024, true),
("unversioned above", 256 * 1024 + 1, false, 128 * 1024 + 1, false),
("versioned below", 32 * 1024 - 1, true, 16 * 1024, true),
("versioned exact", 32 * 1024, true, 16 * 1024, true),
("versioned above", 32 * 1024 + 1, true, 16 * 1024 + 1, false),
] {
let shard_size = erasure.shard_file_size(object_size);
assert_eq!(shard_size, expected_shard_size, "{case}: object_size={object_size}");
assert_eq!(
config.should_inline(shard_size, versioned),
expected,
"{case}: object_size={object_size}, shard_size={shard_size}, versioned={versioned}"
);
}
}
#[test]
fn automatic_parity_is_resolved_per_pool() {
let cfg = lookup_config_for_pools_with_env(&KVS::new(), &[4, 2], no_env_overrides())