From 504b5ac30f39cf52b6caaec2fcfec62ab7f92885 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Fri, 18 Nov 2016 15:24:07 -0500 Subject: [PATCH] database: don't check for waiters in the condition variable predicate. In the last iterations of this patchset, we have moved explicit flushes to acquire the semaphore directly and the coalescing inside the memtable_list. As a result, we are no longer keeping any kind of action for them inside the condition variable. Checking for them has no longer a purpose. This is a cleanup patch that remove does checks. Signed-off-by: Glauber Costa Message-Id: <732676ccfe4ac93eb57aa799ec94b841499a01a6.1479500646.git.glauber@scylladb.com> --- database.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database.cc b/database.cc index 69cc8cc52e..3d387a44a9 100644 --- a/database.cc +++ b/database.cc @@ -2581,8 +2581,8 @@ future<> dirty_memory_manager::flush_when_needed() { return make_ready_future<>(); } // If there are explicit flushes requested, we must wait for them to finish before we stop. - return do_until([this] { return _db_shutdown_requested && !_flush_serializer.waiters(); }, [this] { - auto has_work = [this] { return _flush_serializer.waiters() || over_soft_limit() || _db_shutdown_requested; }; + return do_until([this] { return _db_shutdown_requested; }, [this] { + auto has_work = [this] { return over_soft_limit() || _db_shutdown_requested; }; return _should_flush.wait(std::move(has_work)).then([this] { return get_flush_permit().then([this] (auto permit) { // We give priority to explicit flushes. They are mainly user-initiated flushes,