Skip to content

Commit

Permalink
rocksdb: Expose track-and-verify-wals-in-manifest config (tikv#16546)
Browse files Browse the repository at this point in the history
ref tikv#16549

Expose track-and-verify-wals-in-manifest config.

For further investigating corrupted WAL issue happened during EBS restore process.

Signed-off-by: v01dstar <yang.zhang@pingcap.com>

Co-authored-by: tonyxuqqi <tonyxuqi@outlook.com>
  • Loading branch information
v01dstar and tonyxuqqi committed Feb 28, 2024
1 parent 6353a0b commit 0cf4d1e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions components/engine_panic/src/db_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ impl DbOptions for PanicDbOptions {
fn set_titandb_options(&mut self, opts: &Self::TitanDbOptions) {
panic!()
}

fn set_track_and_verify_wals_in_manifest(&mut self, v: bool) {
panic!()
}
}

pub struct PanicTitanDbOptions;
Expand Down
4 changes: 4 additions & 0 deletions components/engine_rocks/src/db_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ impl DbOptions for RocksDbOptions {
fn set_titandb_options(&mut self, opts: &Self::TitanDbOptions) {
self.0.set_titandb_options(opts.as_raw())
}

fn set_track_and_verify_wals_in_manifest(&mut self, v: bool) {
self.0.set_track_and_verify_wals_in_manifest(v)
}
}

pub struct RocksTitanDbOptions(RawTitanDBOptions);
Expand Down
1 change: 1 addition & 0 deletions components/engine_traits/src/db_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub trait DbOptions {
fn get_rate_limiter_auto_tuned(&self) -> Option<bool>;
fn set_rate_limiter_auto_tuned(&mut self, rate_limiter_auto_tuned: bool) -> Result<()>;
fn set_titandb_options(&mut self, opts: &Self::TitanDbOptions);
fn set_track_and_verify_wals_in_manifest(&mut self, v: bool);
}

/// Titan-specefic options
Expand Down
4 changes: 4 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,8 @@ pub struct DbConfig {
pub enable_multi_batch_write: bool,
#[online_config(skip)]
pub enable_unordered_write: bool,
#[online_config(skip)]
pub track_and_verify_wals_in_manifest: bool,
#[online_config(submodule)]
pub defaultcf: DefaultCfConfig,
#[online_config(submodule)]
Expand Down Expand Up @@ -1144,6 +1146,7 @@ impl Default for DbConfig {
enable_pipelined_write: false,
enable_multi_batch_write: true, // deprecated
enable_unordered_write: false,
track_and_verify_wals_in_manifest: false,
defaultcf: DefaultCfConfig::default(),
writecf: WriteCfConfig::default(),
lockcf: LockCfConfig::default(),
Expand Down Expand Up @@ -1210,6 +1213,7 @@ impl DbConfig {
if self.titan.enabled {
opts.set_titandb_options(&self.titan.build_opts());
}
opts.set_track_and_verify_wals_in_manifest(self.track_and_verify_wals_in_manifest);
opts
}

Expand Down

0 comments on commit 0cf4d1e

Please sign in to comment.