From fcd808833342edbb8052d992b6e7ec85986a056c Mon Sep 17 00:00:00 2001 From: anand76 Date: Tue, 6 Jul 2021 14:15:25 -0700 Subject: [PATCH] Temporarily disable file deletion after open failure in db_stress (#8489) Summary: Write and metadata error injection during DB open was enabled in https://github.com/facebook/rocksdb/issues/8474. This causes crash tests to fail very frequently due to another fault injection feature that deletes files created after the last dir sync during DB open. In real life, a similar failure would happen if the FS returns error on the CURRENT file rename, but the rename actually succeeded and got partially persisted (dir entry for the old CURRENT file got removed, but the entry for the new one is not persisted). Temporarily disable the fault injection feature until we figure out the likelihood of this bug happening and the proper way to fix it. Pull Request resolved: https://github.com/facebook/rocksdb/pull/8489 Test Plan: Stress test can open the DB successfully Reviewed By: siying Differential Revision: D29564516 Pulled By: anand1976 fbshipit-source-id: ffd1650715ea3c5bf7131936b0ca6fcf66f4e14e --- db_stress_tool/db_stress_test_base.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index 5d76b5787..ec5dfeb77 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -2558,10 +2558,16 @@ void StressTest::Open() { ingest_read_error = false; Random rand(static_cast(FLAGS_seed)); +// TODO: This is disabled for now as deleting the CURRENT file after open +// failure causes the DB to not be reopened again due to the presence of +// WAL files, which DB::Open considers to be a corruption. Re-enable once +// we figure out a proper fix +#if 0 if (rand.OneIn(2)) { fault_fs_guard->DeleteFilesCreatedAfterLastDirSync(IOOptions(), nullptr); } +#endif if (rand.OneIn(3)) { fault_fs_guard->DropUnsyncedFileData(); } else if (rand.OneIn(2)) {