diff --git a/src/metric-engine/src/engine/create.rs b/src/metric-engine/src/engine/create.rs index dd3b5cb1f358..d897640cc529 100644 --- a/src/metric-engine/src/engine/create.rs +++ b/src/metric-engine/src/engine/create.rs @@ -456,11 +456,7 @@ impl MetricEngineInner { // concat region dir let metadata_region_dir = join_dir(&request.region_dir, METADATA_REGION_SUBDIR); - // remove TTL and APPEND_MODE option - let mut options = request.options.clone(); - options.insert(TTL_KEY.to_string(), "10000 years".to_string()); - options.remove(APPEND_MODE_KEY); - + let options = region_options_for_metadata_region(request.options.clone()); RegionCreateRequest { engine: MITO_ENGINE_NAME.to_string(), column_metadatas: vec![ @@ -539,6 +535,15 @@ impl MetricEngineInner { } } +/// Creates the region options for metadata region in metric engine. +pub(crate) fn region_options_for_metadata_region( + mut original: HashMap, +) -> HashMap { + original.remove(APPEND_MODE_KEY); + original.insert(TTL_KEY.to_string(), "10000 years".to_string()); + original +} + #[cfg(test)] mod test { use store_api::metric_engine_consts::{METRIC_ENGINE_NAME, PHYSICAL_TABLE_METADATA_KEY}; diff --git a/src/metric-engine/src/engine/open.rs b/src/metric-engine/src/engine/open.rs index bf41099b39b3..aae090f3194d 100644 --- a/src/metric-engine/src/engine/open.rs +++ b/src/metric-engine/src/engine/open.rs @@ -24,6 +24,7 @@ use store_api::region_request::{AffectedRows, RegionOpenRequest, RegionRequest}; use store_api::storage::RegionId; use super::MetricEngineInner; +use crate::engine::create::region_options_for_metadata_region; use crate::engine::options::set_data_region_options; use crate::error::{OpenMitoRegionSnafu, Result}; use crate::metrics::{LOGICAL_REGION_COUNT, PHYSICAL_REGION_COUNT}; @@ -68,9 +69,10 @@ impl MetricEngineInner { let metadata_region_dir = join_dir(&request.region_dir, METADATA_REGION_SUBDIR); let data_region_dir = join_dir(&request.region_dir, DATA_REGION_SUBDIR); + let metadata_region_options = region_options_for_metadata_region(request.options.clone()); let open_metadata_region_request = RegionOpenRequest { region_dir: metadata_region_dir, - options: request.options.clone(), + options: metadata_region_options, engine: MITO_ENGINE_NAME.to_string(), skip_wal_replay: request.skip_wal_replay, }; diff --git a/typos.toml b/typos.toml index c8b2fe33540b..2ce6ac8a4169 100644 --- a/typos.toml +++ b/typos.toml @@ -11,5 +11,6 @@ extend-exclude = [ "tests-fuzz/src/data/lorem_words", "*.sql", "*.result", - "src/pipeline/benches/data.log" + "src/pipeline/benches/data.log", + "cyborg/pnpm-lock.yaml" ]