From 7cf0dc8246cc19b5e4ffac5abe6e4a1e2994272a Mon Sep 17 00:00:00 2001 From: evenyag Date: Tue, 27 Aug 2024 15:20:35 +0800 Subject: [PATCH] fix: fallback to window size in manifest --- src/mito2/src/region/opener.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mito2/src/region/opener.rs b/src/mito2/src/region/opener.rs index 65429478f575..ba72ed7ccbf0 100644 --- a/src/mito2/src/region/opener.rs +++ b/src/mito2/src/region/opener.rs @@ -202,8 +202,8 @@ impl RegionOpener { options.need_dedup(), options.merge_mode(), ); - // Initial memtable id is 0. let part_duration = options.compaction.time_window(); + // Initial memtable id is 0. let mutable = Arc::new(TimePartitions::new( metadata.clone(), memtable_builder.clone(), @@ -335,8 +335,13 @@ impl RegionOpener { region_options.need_dedup(), region_options.merge_mode(), ); + // Use compaction time window in the manifest if region doesn't provide + // the time window option. + let part_duration = region_options + .compaction + .time_window() + .or(manifest.compaction_time_window); // Initial memtable id is 0. - let part_duration = region_options.compaction.time_window(); let mutable = Arc::new(TimePartitions::new( metadata.clone(), memtable_builder.clone(),