mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 11:10:40 +00:00
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 <glauber@scylladb.com> Message-Id: <732676ccfe4ac93eb57aa799ec94b841499a01a6.1479500646.git.glauber@scylladb.com>
This commit is contained in:
committed by
Tomasz Grabiec
parent
1933349654
commit
504b5ac30f
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user