]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Need to schedule compactions when manual compaction finishes
authorsdong <siying.d@fb.com>
Thu, 7 Aug 2014 20:19:58 +0000 (13:19 -0700)
committersdong <siying.d@fb.com>
Fri, 8 Aug 2014 19:28:36 +0000 (12:28 -0700)
Summary: If there is an outstanding compaction scheduled but at the time a manual compaction is triggered, the manual compaction will preempt. In the end of the manual compaction, we should try to schedule compactions to make sure those preempted ones are not skipped.

Test Plan: make all check

Reviewers: yhchiang, ljin

Reviewed By: ljin

Subscribers: leveldb, dhruba, igor

Differential Revision: https://reviews.facebook.net/D21321

db/db_impl.cc

index 5a559fc523df05af1efa6fc52e6ec0e902c5cb4a..43442a15c9982b4fb243ff4c20214fa279db9fec 100644 (file)
@@ -1834,6 +1834,11 @@ Status DBImpl::RunManualCompaction(ColumnFamilyData* cfd, int input_level,
   assert(!manual.in_progress);
   assert(bg_manual_only_ > 0);
   --bg_manual_only_;
+  if (bg_manual_only_ == 0) {
+    // an automatic compaction should have been scheduled might have be
+    // preempted by the manual compactions. Need to schedule it back.
+    MaybeScheduleFlushOrCompaction();
+  }
   return manual.status;
 }