Skip to content

Commit

Permalink
make configurable and enable time travel by default
Browse files Browse the repository at this point in the history
  • Loading branch information
wenym1 committed Sep 11, 2024
1 parent 290ba9d commit 33f6d92
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,9 @@ pub struct StorageConfig {
#[serde(default)]
pub prefetch_buffer_capacity_mb: Option<usize>,

#[serde(default)]
pub max_cached_recent_versions_number: Option<usize>,

/// max prefetch block number
#[serde(default = "default::storage::max_prefetch_block_number")]
pub max_prefetch_block_number: usize,
Expand Down
2 changes: 1 addition & 1 deletion src/common/src/system_param/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ macro_rules! for_all_params {
{ enable_tracing, bool, Some(false), true, "Whether to enable distributed tracing.", },
{ use_new_object_prefix_strategy, bool, None, false, "Whether to split object prefix.", },
{ license_key, risingwave_license::LicenseKey, Some(Default::default()), true, "The license key to activate enterprise features.", },
{ time_travel_retention_ms, u64, Some(0_u64), true, "The data retention period for time travel, where 0 indicates that it's disabled.", },
{ time_travel_retention_ms, u64, Some(600000_u64), true, "The data retention period for time travel, where 0 indicates that it's disabled.", },
}
};
}
Expand Down
3 changes: 2 additions & 1 deletion src/config/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,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_concurrent_compaction_task_number | | 16 |
| max_prefetch_block_number | max prefetch block number | 16 |
| max_preload_io_retry_times | | 3 |
Expand Down Expand Up @@ -169,5 +170,5 @@ This page is automatically generated by `./risedev generate-example-config`
| pause_on_next_bootstrap | Whether to pause all data sources on next bootstrap. | false |
| sstable_size_mb | Target size of the Sstable. | 256 |
| state_store | URL for the state store | |
| time_travel_retention_ms | The data retention period for time travel, where 0 indicates that it's disabled. | 0 |
| time_travel_retention_ms | The data retention period for time travel, where 0 indicates that it's disabled. | 600000 |
| use_new_object_prefix_strategy | Whether to split object prefix. | |
2 changes: 1 addition & 1 deletion src/config/example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,4 @@ max_concurrent_creating_streaming_jobs = 1
pause_on_next_bootstrap = false
enable_tracing = false
license_key = ""
time_travel_retention_ms = 0
time_travel_retention_ms = 600000
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ impl HummockEventHandler {
version_update_notifier_tx,
recent_versions: Arc::new(ArcSwap::from_pointee(RecentVersions::new(
pinned_version,
60,
storage_opts.max_cached_recent_versions_number,
))),
write_conflict_detector,
read_version_mapping,
Expand Down
6 changes: 6 additions & 0 deletions src/storage/src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ pub struct StorageOpts {
/// max memory usage for large query.
pub prefetch_buffer_capacity_mb: usize,

pub max_cached_recent_versions_number: usize,

pub max_prefetch_block_number: usize,

pub disable_remote_compactor: bool,
Expand Down Expand Up @@ -170,6 +172,10 @@ 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_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,
Expand Down

0 comments on commit 33f6d92

Please sign in to comment.