rocksdb/db/db_impl
Andrew Kryczka c6abe30ee3 Fix concurrent full purge and WAL recycling (#5900)
Summary:
We were removing the file from `log_recycle_files_` before renaming it
with `ReuseWritableFile()`. Since `ReuseWritableFile()` occurs outside
the DB mutex, it was possible for a concurrent full purge to sneak in
and delete the file before it could be renamed. Consequently, `SwitchMemtable()`
would fail and the DB would enter read-only mode.

The fix is to hold the old file number in `log_recycle_files_` until
after the file has been renamed. Full purge uses that list to decide
which files to keep, so it can no longer delete a file pending recycling.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5900

Test Plan: new unit test

Differential Revision: D19771719

Pulled By: ajkr

fbshipit-source-id: 094346349ca3fb499712e62de03905acc30b5ce8
2020-02-18 13:54:13 -08:00
..
db_impl_compaction_flush.cc Checksum for each SST file and stores in MANIFEST (#6216) 2020-02-10 15:52:52 -08:00
db_impl_debug.cc Fix concurrent full purge and WAL recycling (#5900) 2020-02-18 13:54:13 -08:00
db_impl_experimental.cc Checksum for each SST file and stores in MANIFEST (#6216) 2020-02-10 15:52:52 -08:00
db_impl_files.cc Clean up VersionEdit a bit (#6383) 2020-02-07 13:27:06 -08:00
db_impl_open.cc Fix concurrent full purge and WAL recycling (#5900) 2020-02-18 13:54:13 -08:00
db_impl_readonly.cc Apply formatter on recent 45 commits. (#5827) 2019-09-19 12:34:17 -07:00
db_impl_readonly.h Use delete to disable automatic generated methods. (#5009) 2019-09-11 18:09:00 -07:00
db_impl_secondary.cc Add an option to prevent DB::Open() from querying sizes of all sst files (#6353) 2020-02-04 01:27:26 -08:00
db_impl_secondary.h Double Crash in kPointInTimeRecovery with TransactionDB (#6313) 2020-01-29 11:40:55 -08:00
db_impl_write.cc Fix concurrent full purge and WAL recycling (#5900) 2020-02-18 13:54:13 -08:00
db_impl.cc Fix destroydb (#6308) 2020-02-13 11:21:27 -08:00
db_impl.h Fix concurrent full purge and WAL recycling (#5900) 2020-02-18 13:54:13 -08:00
db_secondary_test.cc Break db_stress_tool.cc to a list of source files (#6134) 2019-12-08 23:51:01 -08:00