diff --git a/src/common/src/config.rs b/src/common/src/config.rs index ce2cf19f6e2bf..1cf07dd5d7f16 100644 --- a/src/common/src/config.rs +++ b/src/common/src/config.rs @@ -711,8 +711,8 @@ pub struct StorageConfig { #[serde(default)] pub prefetch_buffer_capacity_mb: Option, - #[serde(default)] - pub max_cached_recent_versions_number: Option, + #[serde(default = "default::storage::max_cached_recent_versions_number")] + pub max_cached_recent_versions_number: usize, /// max prefetch block number #[serde(default = "default::storage::max_prefetch_block_number")] @@ -1554,6 +1554,10 @@ pub mod default { cfg!(debug_assertions) } + pub fn max_cached_recent_versions_number() -> usize { + 60 + } + pub fn block_cache_capacity_mb() -> usize { 512 } diff --git a/src/config/ci.toml b/src/config/ci.toml index 43e9836bd304f..c1a42b8345b70 100644 --- a/src/config/ci.toml +++ b/src/config/ci.toml @@ -15,6 +15,7 @@ stream_exchange_concurrent_barriers = 10 [storage] imm_merge_threshold = 2 +max_cached_recent_versions_number = 200 [storage.object_store.retry] streaming_upload_attempt_timeout_ms = 10000 diff --git a/src/config/docs.md b/src/config/docs.md index b844046a38f3c..6e5a1359ca671 100644 --- a/src/config/docs.md +++ b/src/config/docs.md @@ -121,7 +121,7 @@ This page is automatically generated by `./risedev generate-example-config` | enable_fast_compaction | | true | | high_priority_ratio_in_percent | DEPRECATED: This config will be deprecated in the future version, use `storage.cache.block_cache_eviction.high_priority_ratio_in_percent` with `storage.cache.block_cache_eviction.algorithm = "Lru"` instead. | | | imm_merge_threshold | The threshold for the number of immutable memtables to merge to a new imm. | 0 | -| max_cached_recent_versions_number | | | +| max_cached_recent_versions_number | | 60 | | max_concurrent_compaction_task_number | | 16 | | max_prefetch_block_number | max prefetch block number | 16 | | max_preload_io_retry_times | | 3 | diff --git a/src/config/example.toml b/src/config/example.toml index ef39426d1b8a0..0d01a09d12875 100644 --- a/src/config/example.toml +++ b/src/config/example.toml @@ -137,6 +137,7 @@ shared_buffer_flush_ratio = 0.800000011920929 shared_buffer_min_batch_flush_size_mb = 800 imm_merge_threshold = 0 write_conflict_detection_enabled = true +max_cached_recent_versions_number = 60 max_prefetch_block_number = 16 disable_remote_compactor = false share_buffer_upload_concurrency = 8 diff --git a/src/storage/src/opts.rs b/src/storage/src/opts.rs index 13bcd7eb766fc..14500f7c5113e 100644 --- a/src/storage/src/opts.rs +++ b/src/storage/src/opts.rs @@ -177,10 +177,7 @@ impl From<(&RwConfig, &SystemParamsReader, &StorageMemoryConfig)> for StorageOpt meta_cache_shard_num: s.meta_cache_shard_num, meta_cache_eviction_config: s.meta_cache_eviction_config.clone(), prefetch_buffer_capacity_mb: s.prefetch_buffer_capacity_mb, - max_cached_recent_versions_number: c - .storage - .max_cached_recent_versions_number - .unwrap_or(60), + max_cached_recent_versions_number: c.storage.max_cached_recent_versions_number, max_prefetch_block_number: c.storage.max_prefetch_block_number, disable_remote_compactor: c.storage.disable_remote_compactor, share_buffer_upload_concurrency: c.storage.share_buffer_upload_concurrency,