add conf item to disable rocksdb compaction

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-07-24 09:04:16 +00:00
parent 7d487d53d8
commit f014231644
2 changed files with 4 additions and 0 deletions

View File

@ -236,6 +236,8 @@ pub struct Config {
pub rocksdb_compaction_prio_idle: bool,
#[serde(default = "true_fn")]
pub rocksdb_compaction_ioprio_idle: bool,
#[serde(default = "true_fn")]
pub rocksdb_compaction: bool,
pub emergency_password: Option<String>,
@ -712,6 +714,7 @@ impl fmt::Display for Config {
"RocksDB Compaction Idle IOPriority",
&self.rocksdb_compaction_ioprio_idle.to_string(),
);
line("RocksDB Compaction enabled", &self.rocksdb_compaction.to_string());
line("Media integrity checks on startup", &self.media_startup_check.to_string());
line("Media compatibility filesystem links", &self.media_compat_file_link.to_string());
line("Prevent Media Downloads From", {

View File

@ -68,6 +68,7 @@ pub(crate) fn db_options(config: &Config, env: &mut Env, row_cache: &Cache, col_
set_compression_defaults(&mut opts, config);
// Misc
opts.set_disable_auto_compactions(!config.rocksdb_compaction);
opts.create_if_missing(true);
// Default: https://github.com/facebook/rocksdb/wiki/WAL-Recovery-Modes#ktoleratecorruptedtailrecords