diff --git a/src/datanode/src/datanode.rs b/src/datanode/src/datanode.rs index 3674cab0be49..461186a8ada7 100644 --- a/src/datanode/src/datanode.rs +++ b/src/datanode/src/datanode.rs @@ -371,7 +371,7 @@ impl DatanodeBuilder { engine: engine.clone(), region_dir, options, - skip_replay_wal: false, + skip_wal_replay: false, }), ) .await?; diff --git a/src/datanode/src/heartbeat/handler.rs b/src/datanode/src/heartbeat/handler.rs index 97fbe623f71b..fd1c7eb9603d 100644 --- a/src/datanode/src/heartbeat/handler.rs +++ b/src/datanode/src/heartbeat/handler.rs @@ -64,7 +64,7 @@ impl RegionHeartbeatResponseHandler { engine: region_ident.engine, region_dir: region_dir(®ion_storage_path, region_id), options: region_options, - skip_replay_wal: false, + skip_wal_replay: false, }); let result = region_server.handle_request(region_id, request).await; diff --git a/src/file-engine/src/region.rs b/src/file-engine/src/region.rs index 7261aed12740..a5af6822285e 100644 --- a/src/file-engine/src/region.rs +++ b/src/file-engine/src/region.rs @@ -163,7 +163,7 @@ mod tests { engine: "file".to_string(), region_dir, options: HashMap::default(), - skip_replay_wal: false, + skip_wal_replay: false, }; let region = FileRegion::open(region_id, request, &object_store) @@ -212,7 +212,7 @@ mod tests { engine: "file".to_string(), region_dir, options: HashMap::default(), - skip_replay_wal: false, + skip_wal_replay: false, }; let err = FileRegion::open(region_id, request, &object_store) .await diff --git a/src/mito2/src/engine/alter_test.rs b/src/mito2/src/engine/alter_test.rs index 8f03685f94e9..e99571cb4498 100644 --- a/src/mito2/src/engine/alter_test.rs +++ b/src/mito2/src/engine/alter_test.rs @@ -119,7 +119,7 @@ async fn test_alter_region() { engine: String::new(), region_dir, options: HashMap::default(), - skip_replay_wal: false, + skip_wal_replay: false, }), ) .await @@ -202,7 +202,7 @@ async fn test_put_after_alter() { engine: String::new(), region_dir, options: HashMap::default(), - skip_replay_wal: false, + skip_wal_replay: false, }), ) .await diff --git a/src/mito2/src/engine/basic_test.rs b/src/mito2/src/engine/basic_test.rs index 3a56f1fea39b..2e3dc4de0d53 100644 --- a/src/mito2/src/engine/basic_test.rs +++ b/src/mito2/src/engine/basic_test.rs @@ -117,7 +117,7 @@ async fn test_region_replay() { engine: String::new(), region_dir, options: HashMap::default(), - skip_replay_wal: false, + skip_wal_replay: false, }), ) .await diff --git a/src/mito2/src/engine/open_test.rs b/src/mito2/src/engine/open_test.rs index 196ddc031d94..1e0d79af6742 100644 --- a/src/mito2/src/engine/open_test.rs +++ b/src/mito2/src/engine/open_test.rs @@ -43,7 +43,7 @@ async fn test_engine_open_empty() { engine: String::new(), region_dir: "empty".to_string(), options: HashMap::default(), - skip_replay_wal: false, + skip_wal_replay: false, }), ) .await @@ -75,7 +75,7 @@ async fn test_engine_open_existing() { engine: String::new(), region_dir, options: HashMap::default(), - skip_replay_wal: false, + skip_wal_replay: false, }), ) .await @@ -164,7 +164,7 @@ async fn test_engine_region_open_with_options() { engine: String::new(), region_dir, options: HashMap::from([("ttl".to_string(), "4d".to_string())]), - skip_replay_wal: false, + skip_wal_replay: false, }), ) .await @@ -209,7 +209,7 @@ async fn test_engine_region_open_with_custom_store() { engine: String::new(), region_dir, options: HashMap::from([("storage".to_string(), "Gcs".to_string())]), - skip_replay_wal: false, + skip_wal_replay: false, }), ) .await @@ -232,7 +232,7 @@ async fn test_engine_region_open_with_custom_store() { } #[tokio::test] -async fn test_open_region_skip_replay_wal() { +async fn test_open_region_skip_wal_replay() { let mut env = TestEnv::new(); let engine = env.create_engine(MitoConfig::default()).await; @@ -261,7 +261,7 @@ async fn test_open_region_skip_replay_wal() { put_rows(&engine, region_id, rows).await; let engine = env.reopen_engine(engine, MitoConfig::default()).await; - // Skip to replay the WAL. + // Skip the WAL replay . engine .handle_request( region_id, @@ -269,7 +269,7 @@ async fn test_open_region_skip_replay_wal() { engine: String::new(), region_dir: region_dir.to_string(), options: Default::default(), - skip_replay_wal: true, + skip_wal_replay: true, }), ) .await @@ -298,7 +298,7 @@ async fn test_open_region_skip_replay_wal() { engine: String::new(), region_dir, options: Default::default(), - skip_replay_wal: false, + skip_wal_replay: false, }), ) .await diff --git a/src/mito2/src/engine/parallel_test.rs b/src/mito2/src/engine/parallel_test.rs index 2b805e9a99b3..c6c97f68d269 100644 --- a/src/mito2/src/engine/parallel_test.rs +++ b/src/mito2/src/engine/parallel_test.rs @@ -50,7 +50,7 @@ async fn scan_in_parallel( engine: String::new(), region_dir: region_dir.to_string(), options: HashMap::default(), - skip_replay_wal: false, + skip_wal_replay: false, }), ) .await diff --git a/src/mito2/src/engine/truncate_test.rs b/src/mito2/src/engine/truncate_test.rs index a7574e52f451..b9336afad3d1 100644 --- a/src/mito2/src/engine/truncate_test.rs +++ b/src/mito2/src/engine/truncate_test.rs @@ -250,7 +250,7 @@ async fn test_engine_truncate_reopen() { engine: String::new(), region_dir, options: HashMap::default(), - skip_replay_wal: false, + skip_wal_replay: false, }), ) .await @@ -354,7 +354,7 @@ async fn test_engine_truncate_during_flush() { engine: String::new(), region_dir, options: HashMap::default(), - skip_replay_wal: false, + skip_wal_replay: false, }), ) .await diff --git a/src/mito2/src/region/opener.rs b/src/mito2/src/region/opener.rs index 43ab9b1d68ef..ea387ef2c552 100644 --- a/src/mito2/src/region/opener.rs +++ b/src/mito2/src/region/opener.rs @@ -54,7 +54,7 @@ pub(crate) struct RegionOpener { scheduler: SchedulerRef, options: HashMap, cache_manager: Option, - skip_replay_wal: bool, + skip_wal_replay: bool, } impl RegionOpener { @@ -75,7 +75,7 @@ impl RegionOpener { scheduler, options: HashMap::new(), cache_manager: None, - skip_replay_wal: false, + skip_wal_replay: false, } } @@ -97,8 +97,9 @@ impl RegionOpener { self } - pub(crate) fn skip_replay_wal(mut self, skip: bool) -> Self { - self.skip_replay_wal = skip; + /// Sets the `skip_wal_replay`. + pub(crate) fn skip_wal_replay(mut self, skip: bool) -> Self { + self.skip_wal_replay = skip; self } @@ -242,10 +243,10 @@ impl RegionOpener { .build(); let flushed_entry_id = version.flushed_entry_id; let version_control = Arc::new(VersionControl::new(version)); - if !self.skip_replay_wal { + if !self.skip_wal_replay { replay_memtable(wal, region_id, flushed_entry_id, &version_control).await?; } else { - info!("Skip to replay the WAL for region: {}", region_id); + info!("Skip the WAL replay for region: {}", region_id); } let region = MitoRegion { diff --git a/src/mito2/src/test_util.rs b/src/mito2/src/test_util.rs index 6a6a35c5872a..63416a640f3b 100644 --- a/src/mito2/src/test_util.rs +++ b/src/mito2/src/test_util.rs @@ -696,7 +696,7 @@ pub async fn reopen_region( engine: String::new(), region_dir, options: HashMap::default(), - skip_replay_wal: false, + skip_wal_replay: false, }), ) .await diff --git a/src/mito2/src/worker/handle_open.rs b/src/mito2/src/worker/handle_open.rs index 1d0c33628870..49100bee5199 100644 --- a/src/mito2/src/worker/handle_open.rs +++ b/src/mito2/src/worker/handle_open.rs @@ -70,7 +70,7 @@ impl RegionWorkerLoop { self.scheduler.clone(), ) .options(request.options) - .skip_replay_wal(request.skip_replay_wal) + .skip_wal_replay(request.skip_wal_replay) .cache(Some(self.cache_manager.clone())) .open(&self.config, &self.wal) .await?; diff --git a/src/store-api/src/region_request.rs b/src/store-api/src/region_request.rs index bf0bb4c315f9..daa2ae3753a5 100644 --- a/src/store-api/src/region_request.rs +++ b/src/store-api/src/region_request.rs @@ -116,7 +116,7 @@ impl RegionRequest { engine: open.engine, region_dir, options: open.options, - skip_replay_wal: false, + skip_wal_replay: false, }), )]) } @@ -199,7 +199,7 @@ pub struct RegionOpenRequest { /// Options of the opened region. pub options: HashMap, /// To skip replaying the WAL. - pub skip_replay_wal: bool, + pub skip_wal_replay: bool, } /// Close region request.