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
This commit is contained in:
Sunguck Lee 2018-01-16 13:10:34 -08:00 committed by Facebook Github Bot
parent d0f1b49ab6
commit af92d4ad11

View File

@ -1506,7 +1506,7 @@ Status DBImpl::BackgroundCompaction(bool* made_progress,
: m->manual_end->DebugString().c_str())); : m->manual_end->DebugString().c_str()));
} }
} else if (!is_prepicked && !compaction_queue_.empty()) { } else if (!is_prepicked && !compaction_queue_.empty()) {
if (HaveManualCompaction(compaction_queue_.front())) { if (HasExclusiveManualCompaction()) {
// Can't compact right now, but try again later // Can't compact right now, but try again later
TEST_SYNC_POINT("DBImpl::BackgroundCompaction()::Conflict"); TEST_SYNC_POINT("DBImpl::BackgroundCompaction()::Conflict");