]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Encode min_log_number_to_keep and delete_wals_before in one version edit (#9766)
authorYanqin Jin <yanqin@fb.com>
Fri, 1 Apr 2022 03:00:52 +0000 (20:00 -0700)
committerAndrew Kryczka <andrewkr@fb.com>
Mon, 18 Apr 2022 17:43:05 +0000 (10:43 -0700)
commit7e42a5ba8955f8d7d76ae83f0ab60dd1a58d4c76
tree305cd088696b73e3294b3f422181c2fd6171ed27
parent8654ac5d9a5c17c3daceac42eb96e6b72564f370
Encode min_log_number_to_keep and delete_wals_before in one version edit (#9766)

Summary:
min_log_number_to_keep denotes that the WALs whose numbers are below
this value **will** be deleted by RocksDB.
delete_wals_before will be used by RocksDB if
track_and_verify_wals_in_manifest is set to true. During recovery,
RocksDB uses the info encoded in delete_wals_before to reconstruct its
knowledge about what WALs to expect existing.
If these two tags are not encoded in the same VersionEdit, then it's
possible for min_log_number_to_keep=100 to exist, but
delete_wals_before=100 to be lost due to power failure. Subsequent
recovery will delete 99.log. If the db crashes again, the following
recovery will expect to see 99.log since there is no
delete_wals_before=100 in the MANIFEST, but the WAL is already deleted.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/9766

Test Plan:
First of all, make check.
Second, format compatibility.
SHORT_TEST=1 ./tools/check_format_compatible.sh

Reviewed By: ltamasi

Differential Revision: D35203623

Pulled By: riversand963

fbshipit-source-id: 45623fc4b4b50d299d5e0f9559a3a4c5e9522c8f
HISTORY.md
db/db_flush_test.cc
db/memtable_list.cc
db/version_edit.cc