diff --git a/HISTORY.md b/HISTORY.md index 28db167209f..1fbfc8deec5 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -7,6 +7,8 @@ * A new option `std::shared_ptr file_checksum_gen_factory` is added to `BackupableDBOptions`. The default value for this option is `nullptr`. If this option is null, the default backup engine checksum function (crc32c) will be used for creating, verifying, or restoring backups. If it is not null and is set to the DB custom checksum factory, the custom checksum function used in DB will also be used for creating, verifying, or restoring backups, in addition to the default checksum function (crc32c). If it is not null and is set to a custom checksum factory different than the DB custom checksum factory (which may be null), BackupEngine will return `Status::InvalidArgument()`. * A new field `std::string requested_checksum_func_name` is added to `FileChecksumGenContext`, which enables the checksum factory to create generators for a suite of different functions. +### Public API Change +* Re-enable WAL recycling (`recycle_log_file_num`) when `kPointInTimeRecovery` or `kAbsoluteConsistency` recovery mode is requested. WAL recycling has been disabled with these recovery modes since RocksDB 6.8. ## 6.12 (2020-07-28) ### Public API Change diff --git a/db/db_impl/db_impl_open.cc b/db/db_impl/db_impl_open.cc index 286bc56480e..dd51fdd6792 100644 --- a/db/db_impl/db_impl_open.cc +++ b/db/db_impl/db_impl_open.cc @@ -92,11 +92,12 @@ DBOptions SanitizeOptions(const std::string& dbname, const DBOptions& src) { if (result.recycle_log_file_num && (result.wal_recovery_mode == WALRecoveryMode::kPointInTimeRecovery || result.wal_recovery_mode == WALRecoveryMode::kAbsoluteConsistency)) { - // kPointInTimeRecovery is inconsistent with recycle log file feature since - // we define the "end" of the log as the first corrupt record we encounter. + // kPointInTimeRecovery is indistinguishable from + // kTolerateCorruptedTailRecords in recycle mode since we define + // the "end" of the log as the first corrupt record we encounter. // kAbsoluteConsistency doesn't make sense because even a clean // shutdown leaves old junk at the end of the log file. - result.recycle_log_file_num = 0; + result.wal_recovery_mode = WALRecoveryMode::kTolerateCorruptedTailRecords; } if (result.wal_dir.empty()) {