Skip to content

Commit

Permalink
Avoid too frequent MaybeScheduleFlushOrCompaction() call
Browse files Browse the repository at this point in the history
Summary:
If there's manual compaction in the queue, then "HaveManualCompaction(compaction_queue_.front())" will return true, and this cause too frequent MaybeScheduleFlushOrCompaction().

facebook#3198
Closes facebook#3366

Differential Revision: D6729575

Pulled By: ajkr

fbshipit-source-id: 96da04f8fd33297b1ccaec3badd9090403da29b0
  • Loading branch information
SunguckLee authored and facebook-github-bot committed Jan 16, 2018
1 parent d0f1b49 commit af92d4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/db_impl_compaction_flush.cc
Expand Up @@ -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");

Expand Down

0 comments on commit af92d4a

Please sign in to comment.