aboutsummaryrefslogtreecommitdiff
path: root/db/db_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'db/db_impl.cc')
-rw-r--r--db/db_impl.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/db/db_impl.cc b/db/db_impl.cc
index 1ec2afb..f96d245 100644
--- a/db/db_impl.cc
+++ b/db/db_impl.cc
@@ -629,6 +629,11 @@ void DBImpl::TEST_CompactRange(int level, const Slice* begin,
background_work_finished_signal_.Wait();
}
}
+ // Finish current background compaction in the case where
+ // `background_work_finished_signal_` was signalled due to an error.
+ while (background_compaction_scheduled_) {
+ background_work_finished_signal_.Wait();
+ }
if (manual_compaction_ == &manual) {
// Cancel my manual compaction since we aborted early for some reason.
manual_compaction_ = nullptr;