Skip to content

Commit

Permalink
chore: rename skip_replay_wal to skip_wal_replay
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Dec 19, 2023
1 parent d33f3eb commit 04fb774
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/mito2/src/engine/open_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
13 changes: 7 additions & 6 deletions src/mito2/src/region/opener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub(crate) struct RegionOpener {
scheduler: SchedulerRef,
options: HashMap<String, String>,
cache_manager: Option<CacheManagerRef>,
skip_replay_wal: bool,
skip_wal_replay: bool,
}

impl RegionOpener {
Expand All @@ -75,7 +75,7 @@ impl RegionOpener {
scheduler,
options: HashMap::new(),
cache_manager: None,
skip_replay_wal: false,
skip_wal_replay: false,
}
}

Expand All @@ -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
}

Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/mito2/src/worker/handle_open.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl<S: LogStore> RegionWorkerLoop<S> {
self.scheduler.clone(),
)
.options(request.options)
.skip_replay_wal(request.skip_replay_wal)
.skip_wal_replay(request.skip_replay_wal)
.cache(Some(self.cache_manager.clone()))
.open(&self.config, &self.wal)
.await?;
Expand Down

0 comments on commit 04fb774

Please sign in to comment.