0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-28 19:58:53 +02:00

ircd::db::database: Pair 'recover' open value with WAL skip consistency.

This commit is contained in:
Jason Volk 2020-10-29 04:56:29 -07:00
parent 1244002de3
commit eaefcceefb

View file

@ -970,7 +970,7 @@ try
// When corrupted after crash, the DB is rolled back before the first
// corruption and erases everything after it, giving a consistent
// state up at that point, though losing some recent data.
if(string_view(open_recover) == "point" || string_view(open_recover) == "recover")
if(string_view(open_recover) == "point")
opts->wal_recovery_mode = rocksdb::WALRecoveryMode::kPointInTimeRecovery;
// When corrupted after crash and PointInTimeRecovery does not work,
@ -984,7 +984,7 @@ try
// Skipping corrupted records will create gaps in the DB timeline where the
// application (like a matrix timeline) cannot tolerate the unexpected gap.
if(string_view(open_recover) == "skip")
if(string_view(open_recover) == "skip" || string_view(open_recover) == "recover")
opts->wal_recovery_mode = rocksdb::WALRecoveryMode::kSkipAnyCorruptedRecords;
// Tolerating corrupted records is very last-ditch for getting the database to