From 29e91cb2c2a909501a1b20e0ce6e94be2648af7f Mon Sep 17 00:00:00 2001 From: Yuval Ariel Date: Sun, 11 Feb 2024 14:30:35 +0200 Subject: [PATCH 1/2] CancelAllBackgroundWork: Flush does not wait for stall conditions to clear --- db/db_impl/db_impl.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/db_impl/db_impl.cc b/db/db_impl/db_impl.cc index c5a118ba9..40ac90587 100644 --- a/db/db_impl/db_impl.cc +++ b/db/db_impl/db_impl.cc @@ -550,7 +550,9 @@ void DBImpl::CancelAllBackgroundWork(bool wait) { if (!shutting_down_.load(std::memory_order_acquire) && has_unpersisted_data_.load(std::memory_order_relaxed) && !mutable_db_options_.avoid_flush_during_shutdown) { - s = DBImpl::FlushAllColumnFamilies(FlushOptions(), FlushReason::kShutDown); + auto flush_options = FlushOptions(); + flush_options.allow_write_stall = true; + s = DBImpl::FlushAllColumnFamilies(flush_options, FlushReason::kShutDown); s.PermitUncheckedError(); //**TODO: What to do on error? } From 67b7b6188b95289a37ea1582c2937d590911c010 Mon Sep 17 00:00:00 2001 From: Yuval Ariel Date: Sun, 11 Feb 2024 17:48:51 +0200 Subject: [PATCH 2/2] update history --- HISTORY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.md b/HISTORY.md index a80bd9ca6..7e3c674ba 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -7,6 +7,7 @@ ### Enhancements ### Bug Fixes +* CancelAllBackgroundWork: Flush does not wait for stall conditions to clear ### Miscellaneous * WriteController logging: Remove redundant reports when WC is not shared between dbs