rocksdb/db/db_impl
Yu Zhang 509947ce2c Quarantine files in a limbo state after a manifest error (#12030)
Summary:
Part of the procedures to handle manifest IO error is to disable file deletion in case some files in limbo state get deleted prematurely. This is not ideal because: 1) not all the VersionEdits whose commit encounter such an error contain updates for files, disabling file deletion sometimes are not necessary. 2) `EnableFileDeletion` has a force mode that could make other threads accidentally disrupt this procedure in recovery.  3) Disabling file deletion as a whole is also not as efficient as more precisely tracking impacted files from being prematurely deleted.  This PR replaces this mechanism with tracking such files and quarantine them from being deleted in `ErrorHandler`.

These are the types of files being actively tracked in quarantine in this PR:
1) new table files and blob files from a background job
2) old manifest file whose immediately following new manifest file's CURRENT file creation gets into unclear state. Current handling is not sufficient to make sure the old manifest file is kept in case it's needed.

Note that WAL logs are not part of the quarantine because `min_log_number_to_keep` is a safe mechanism and it's only updated after successful manifest commits so it can prevent this premature deletion issue from happening.

We track these files' file numbers because they share the same file number space.

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

Test Plan: Modified existing unit tests

Reviewed By: ajkr

Differential Revision: D51036774

Pulled By: jowlyzhang

fbshipit-source-id: 84ef26271fbbc888ef70da5c40fe843bd7038716
2023-11-11 08:11:11 -08:00
..
compacted_db_impl.cc Track full_history_ts_low per SuperVersion (#11784) 2023-09-13 16:34:18 -07:00
compacted_db_impl.h Group rocksdb.sst.read.micros stat by different user read IOActivity + misc (#11444) 2023-08-08 17:26:50 -07:00
db_impl.cc Quarantine files in a limbo state after a manifest error (#12030) 2023-11-11 08:11:11 -08:00
db_impl.h Quarantine files in a limbo state after a manifest error (#12030) 2023-11-11 08:11:11 -08:00
db_impl_compaction_flush.cc Make OffpeakTimeInfo available in VersionSet (#12018) 2023-10-27 15:56:48 -07:00
db_impl_debug.cc Quarantine files in a limbo state after a manifest error (#12030) 2023-11-11 08:11:11 -08:00
db_impl_experimental.cc Record the persist_user_defined_timestamps flag in manifest (#11515) 2023-06-21 21:49:01 -07:00
db_impl_files.cc Quarantine files in a limbo state after a manifest error (#12030) 2023-11-11 08:11:11 -08:00
db_impl_open.cc Drop wal record when sequence is illegal (#11985) 2023-11-09 10:43:16 -08:00
db_impl_readonly.cc GetEntity Support for ReadOnlyDB and SecondaryDB (#11799) 2023-09-15 08:30:44 -07:00
db_impl_readonly.h AttributeGroups - PutEntity Implementation (#11977) 2023-11-06 16:52:51 -08:00
db_impl_secondary.cc Expose more info about input files in CompactionFilter::Context (#11857) 2023-09-20 13:34:39 -07:00
db_impl_secondary.h AttributeGroups - PutEntity Implementation (#11977) 2023-11-06 16:52:51 -08:00
db_impl_write.cc AttributeGroups - PutEntity Implementation (#11977) 2023-11-06 16:52:51 -08:00