diff options
author | Charles Hall <charles@computer.surgery> | 2023-07-26 15:32:36 -0700 |
---|---|---|
committer | Charles Hall <charles@computer.surgery> | 2023-07-26 15:32:36 -0700 |
commit | 9fb849806783c82934dc74d32849e194e224ed90 (patch) | |
tree | 9fe6d3378069ef5bb0867f4bd8e98ea899209f9a /src/database | |
parent | 81866170f00ce70f4e7d4de0ee9e89562860a604 (diff) | |
download | conduit-9fb849806783c82934dc74d32849e194e224ed90.zip |
relax recovery mode
Diffstat (limited to 'src/database')
-rw-r--r-- | src/database/abstraction/rocksdb.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/database/abstraction/rocksdb.rs b/src/database/abstraction/rocksdb.rs index f0b5f2a..b40c439 100644 --- a/src/database/abstraction/rocksdb.rs +++ b/src/database/abstraction/rocksdb.rs @@ -49,6 +49,13 @@ fn db_options(max_open_files: i32, rocksdb_cache: &rocksdb::Cache) -> rocksdb::O db_opts.set_max_background_jobs(6); db_opts.set_bytes_per_sync(1048576); + // https://github.com/facebook/rocksdb/wiki/WAL-Recovery-Modes#ktoleratecorruptedtailrecords + // + // Unclean shutdowns of a Matrix homeserver are likely to be fine when + // recovered in this manner as it's likely any lost information will be + // restored via federation. + db_opts.set_wal_recovery_mode(rocksdb::DBRecoveryMode::TolerateCorruptedTailRecords); + let prefix_extractor = rocksdb::SliceTransform::create_fixed_prefix(1); db_opts.set_prefix_extractor(prefix_extractor); |