Skip to content

Commit

Permalink
rocksdb: Expose track-and-verify-wals-in-manifest config (#16546)
Browse files Browse the repository at this point in the history
ref #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 30099fc commit 9fa462a
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 @@ -59,6 +59,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 @@ -120,6 +120,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 @@ -24,6 +24,7 @@ pub trait DbOptions {
fn get_flush_size(&self) -> Result<u64>;
fn set_flush_oldest_first(&mut self, f: 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/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,8 @@ pub struct DbConfig {
#[doc(hidden)]
#[serde(skip_serializing)]
pub write_buffer_flush_oldest_first: bool,
#[online_config(skip)]
pub track_and_verify_wals_in_manifest: bool,
// Dangerous option only for programming use.
#[online_config(skip)]
#[serde(skip)]
Expand Down Expand Up @@ -1362,6 +1364,7 @@ impl Default for DbConfig {
write_buffer_limit: None,
write_buffer_stall_ratio: 0.0,
write_buffer_flush_oldest_first: true,
track_and_verify_wals_in_manifest: true,
paranoid_checks: None,
defaultcf: DefaultCfConfig::default(),
writecf: WriteCfConfig::default(),
Expand Down Expand Up @@ -1539,6 +1542,7 @@ impl DbConfig {
// Historical stats are not used.
opts.set_stats_persist_period_sec(0);
}
opts.set_track_and_verify_wals_in_manifest(self.track_and_verify_wals_in_manifest);
opts
}

Expand Down

0 comments on commit 9fa462a

Please sign in to comment.