Disable error injection after compaction completion (#11798)

Summary:
https://github.com/facebook/rocksdb/issues/11789 added error injection during compaction to db_stress. However, error injection was not disabled after compaction completion, which resulted in some test failures due to stale errors.

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

Reviewed By: cbi42

Differential Revision: D49022821

Pulled By: anand1976

fbshipit-source-id: 3cbfe18d55bee393697e063d05e7a7a7f88b7635
This commit is contained in:
anand76 2023-09-06 12:57:10 -07:00 committed by Facebook GitHub Bot
parent 458acf8169
commit 137cd4bb75
1 changed files with 7 additions and 0 deletions

View File

@ -110,6 +110,13 @@ class DbStressListener : public EventListener {
}
}
void OnSubcompactionCompleted(const SubcompactionJobInfo& /* si */) override {
if (FLAGS_read_fault_one_in) {
(void)fault_fs_guard->GetAndResetErrorCount();
fault_fs_guard->DisableErrorInjection();
}
}
void OnTableFileCreationStarted(
const TableFileCreationBriefInfo& /*info*/) override {
++num_pending_file_creations_;