Make the block cache optional (#8066)

Address contention on the store's `block_cache` by allowing it to be disabled when `--block-cache-size 0` is provided, and also making this the default.


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
Michael Sproul
2025-09-18 17:10:18 +10:00
committed by GitHub
parent 92f60b8fd2
commit 51321daabb
5 changed files with 143 additions and 94 deletions

View File

@@ -1839,12 +1839,25 @@ fn slots_per_restore_point_flag() {
.run_with_zero_port();
}
#[test]
fn block_cache_size_default() {
CommandLineTest::new()
.run_with_zero_port()
.with_config(|config| assert_eq!(config.store.block_cache_size, 0));
}
#[test]
fn block_cache_size_flag() {
CommandLineTest::new()
.flag("block-cache-size", Some("4"))
.run_with_zero_port()
.with_config(|config| assert_eq!(config.store.block_cache_size, new_non_zero_usize(4)));
.with_config(|config| assert_eq!(config.store.block_cache_size, 4));
}
#[test]
fn block_cache_size_zero() {
CommandLineTest::new()
.flag("block-cache-size", Some("0"))
.run_with_zero_port()
.with_config(|config| assert_eq!(config.store.block_cache_size, 0));
}
#[test]
fn state_cache_size_default() {