From af92d4ad112f192693f6017f24f9ae1b00e1f053 Mon Sep 17 00:00:00 2001 From: Sunguck Lee Date: Tue, 16 Jan 2018 13:10:34 -0800 Subject: [PATCH] Avoid too frequent MaybeScheduleFlushOrCompaction() call Summary: If there's manual compaction in the queue, then "HaveManualCompaction(compaction_queue_.front())" will return true, and this cause too frequent MaybeScheduleFlushOrCompaction(). https://github.com/facebook/rocksdb/issues/3198 Closes https://github.com/facebook/rocksdb/pull/3366 Differential Revision: D6729575 Pulled By: ajkr fbshipit-source-id: 96da04f8fd33297b1ccaec3badd9090403da29b0 --- db/db_impl_compaction_flush.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/db_impl_compaction_flush.cc b/db/db_impl_compaction_flush.cc index c4b05a594..fc8697d7e 100644 --- a/db/db_impl_compaction_flush.cc +++ b/db/db_impl_compaction_flush.cc @@ -1506,7 +1506,7 @@ Status DBImpl::BackgroundCompaction(bool* made_progress, : m->manual_end->DebugString().c_str())); } } else if (!is_prepicked && !compaction_queue_.empty()) { - if (HaveManualCompaction(compaction_queue_.front())) { + if (HasExclusiveManualCompaction()) { // Can't compact right now, but try again later TEST_SYNC_POINT("DBImpl::BackgroundCompaction()::Conflict");