]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Enable recycle_log_file_num option for point in time recovery (#12403)
authoranand76 <anand1976@users.noreply.github.com>
Thu, 21 Mar 2024 19:29:35 +0000 (12:29 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 21 Mar 2024 19:29:35 +0000 (12:29 -0700)
commit63a105a481c9b8fd489a3a5b28c475b771cf05dd
tree371cb511a3dbad976ff826801f723d9374993aea
parent98d8a856246e6a35de51b40a1647d08af52357a5
Enable recycle_log_file_num option for point in time recovery (#12403)

Summary:
This option was previously disabled due to a bug in the recovery logic. The recovery code in `DBImpl::RecoverLogFiles` couldn't tell if an EoF reported by the log reader was really an EoF or a possible corruption that made a record look like an old log record. To fix this, the log reader now explicitly reports when it encounters what looks like an old record. The recovery code treats it as a possible corruption, and uses the next sequence number in the WAL to determine if it should continue replaying the WAL.

This PR also fixes a couple of bugs that log file recycling exposed in the backup and checkpoint path.

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

Test Plan:
1. Add new unit tests to verify behavior upon corruption
2. Re-enable disabled tests for verifying recycling behavior

Reviewed By: ajkr

Differential Revision: D54544824

Pulled By: anand1976

fbshipit-source-id: 12f5ce39bd6bc0d63b0bc6432dc4db510e0e802a
db/db_filesnapshot.cc
db/db_impl/db_impl.cc
db/db_impl/db_impl_compaction_flush.cc
db/db_impl/db_impl_open.cc
db/db_impl/db_impl_write.cc
db/db_wal_test.cc
db/db_write_test.cc
db/log_reader.cc
db/log_reader.h
tools/db_crashtest.py
unreleased_history/bug_fixes/recycle_logs_point_in_time_recovery.md [new file with mode: 0644]