From 137cd4bb750bec6071254f3b47e89db4d2b58593 Mon Sep 17 00:00:00 2001 From: anand76 Date: Wed, 6 Sep 2023 12:57:10 -0700 Subject: [PATCH] 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 --- db_stress_tool/db_stress_listener.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/db_stress_tool/db_stress_listener.h b/db_stress_tool/db_stress_listener.h index 998a6cc74..aba95d4c0 100644 --- a/db_stress_tool/db_stress_listener.h +++ b/db_stress_tool/db_stress_listener.h @@ -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_; -- GitLab