From 5c585e1908d4b8cff1feab436ccf38da0f5092b7 Mon Sep 17 00:00:00 2001 From: Cheng Chang Date: Thu, 19 Nov 2020 14:44:48 -0800 Subject: [PATCH] Ship the track WAL in MANIFEST feature (#7689) Summary: Updates the option description and HISTORY. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7689 Test Plan: N/A Reviewed By: zhichao-cao Differential Revision: D25056238 Pulled By: cheng-chang fbshipit-source-id: 6af1ef6f8dcf2173cbc0fccadc0e06cefd92bcae --- HISTORY.md | 1 + include/rocksdb/options.h | 14 +++++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index f407339283..8f60d29548 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -26,6 +26,7 @@ ### Public API Change * Deprecate `BlockBasedTableOptions::pin_l0_filter_and_index_blocks_in_cache` and `BlockBasedTableOptions::pin_top_level_index_and_filter`. These options still take effect until users migrate to the replacement APIs in `BlockBasedTableOptions::metadata_cache_options`. Migration guidance can be found in the API comments on the deprecated options. * Add new API `DB::VerifyFileChecksums` to verify SST file checksum with corresponding entries in the MANIFEST if present. Current implementation requires scanning and recomputing file checksums. +* Added a new option `track_and_verify_wals_in_manifest`. If `true`, the log numbers and sizes of the synced WALs are tracked in MANIFEST, then during DB recovery, if a synced WAL is missing from disk, or the WAL's size does not match the recorded size in MANIFEST, an error will be reported and the recovery will be aborted. Note that this option does not work with secondary instance. ### Behavior Changes * The dictionary compression settings specified in `ColumnFamilyOptions::compression_opts` now additionally affect files generated by flush and compaction to non-bottommost level. Previously those settings at most affected files generated by compaction to bottommost level, depending on whether `ColumnFamilyOptions::bottommost_compression_opts` overrode them. Users who relied on dictionary compression settings in `ColumnFamilyOptions::compression_opts` affecting only the bottommost level can keep the behavior by moving their dictionary settings to `ColumnFamilyOptions::bottommost_compression_opts` and setting its `enabled` flag. diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index c62ecb09cd..2bc8aa6266 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -393,18 +393,14 @@ struct DBOptions { // Default: true bool paranoid_checks = true; - // If true, track WALs in MANIFEST and verify them on recovery. + // If true, the log numbers and sizes of the synced WALs are tracked + // in MANIFEST, then during DB recovery, if a synced WAL is missing + // from disk, or the WAL's size does not match the recorded size in + // MANIFEST, an error will be reported and the recovery will be aborted. // - // If a WAL is tracked in MANIFEST but is missing from disk on recovery, - // or the size of the tracked WAL is larger than the WAL's on-disk size, - // an error is reported and recovery is aborted. - // - // If a WAL is not tracked in MANIFEST, then no verification will happen - // during recovery. + // Note that this option does not work with secondary instance. // // Default: false - // FIXME(cheng): This option is part of a work in progress and does not yet - // work bool track_and_verify_wals_in_manifest = false; // Use the specified object to interact with the environment,