summaryrefslogtreecommitdiff
path: root/src/database
diff options
context:
space:
mode:
authorCharles Hall <charles@computer.surgery>2023-07-26 15:32:36 -0700
committerCharles Hall <charles@computer.surgery>2023-07-26 15:32:36 -0700
commit9fb849806783c82934dc74d32849e194e224ed90 (patch)
tree9fe6d3378069ef5bb0867f4bd8e98ea899209f9a /src/database
parent81866170f00ce70f4e7d4de0ee9e89562860a604 (diff)
downloadconduit-9fb849806783c82934dc74d32849e194e224ed90.zip
relax recovery mode
Diffstat (limited to 'src/database')
-rw-r--r--src/database/abstraction/rocksdb.rs7
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);