add conf item for alternate rocksdb recovery modes.

This commit is contained in:
Jason Volk authored and June committed 2024-03-23 01:49:27 -04:00
1 parent a57f4db207
commit 331c0b37cd
2 files changed
+13 -1

No files matched your search

+7 -1
View File
@@ -121,7 +121,13 @@ fn db_options(
// 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(rust_rocksdb::DBRecoveryMode::TolerateCorruptedTailRecords);
db_opts.set_wal_recovery_mode(match config.rocksdb_recovery_mode {
0 => rust_rocksdb::DBRecoveryMode::AbsoluteConsistency,
1 => rust_rocksdb::DBRecoveryMode::TolerateCorruptedTailRecords,
2 => rust_rocksdb::DBRecoveryMode::PointInTime,
3 => rust_rocksdb::DBRecoveryMode::SkipAnyCorruptedRecord,
4_u8..=u8::MAX => unimplemented!(),
});
db_opts.set_block_based_table_factory(&block_based_options);
db_opts.set_env(env);