Avoid .trash handling race in db_stress Checkpoint (#9673)

Summary:
The shared SstFileManager in db_stress can create background
work that races with TestCheckpoint such that DestroyDir fails because
of file rename while it is running. Analogous to change already made
for TestBackupRestore

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

Test Plan:
make blackbox_crash_test for a while with
checkpoint_one_in=100

Reviewed By: ajkr

Differential Revision: D34702215

Pulled By: pdillinger

fbshipit-source-id: ac3e166efa28cba6c6f4b9b391e799394603ebfd
main
Peter Dillinger 3 years ago committed by Facebook GitHub Bot
parent 36aec94d85
commit 4a9ae4f713
  1. 2
      db_stress_tool/db_stress_test_base.cc

@ -1744,6 +1744,8 @@ Status StressTest::TestCheckpoint(ThreadState* thread,
if (s.ok()) { if (s.ok()) {
Options options(options_); Options options(options_);
options.listeners.clear(); options.listeners.clear();
// Avoid race condition in trash handling after delete checkpoint_db
options.sst_file_manager.reset();
std::vector<ColumnFamilyDescriptor> cf_descs; std::vector<ColumnFamilyDescriptor> cf_descs;
// TODO(ajkr): `column_family_names_` is not safe to access here when // TODO(ajkr): `column_family_names_` is not safe to access here when
// `clear_column_family_one_in != 0`. But we can't easily switch to // `clear_column_family_one_in != 0`. But we can't easily switch to

Loading…
Cancel
Save