]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
break Flush wait for dropped CF
authorIslam AbdelRahman <tec@fb.com>
Tue, 13 Dec 2016 22:03:15 +0000 (14:03 -0800)
committerIslam AbdelRahman <tec@fb.com>
Wed, 14 Dec 2016 21:05:17 +0000 (13:05 -0800)
Summary:
In FlushJob we dont do the Flush if the CF is dropped
https://github.com/facebook/rocksdb/blob/master/db/flush_job.cc#L184-L188

but inside WaitForFlushMemTable we keep waiting forever even if the CF is dropped.
Closes https://github.com/facebook/rocksdb/pull/1664

Differential Revision: D4321032

Pulled By: IslamAbdelRahman

fbshipit-source-id: 6e2b25d

db/db_impl.cc

index 67658e9383e00119fe2a080d2f64d5d9b43a8364..70127b168d5fb0284fa67ac03d5755a8cc77c88d 100644 (file)
@@ -2956,6 +2956,12 @@ Status DBImpl::WaitForFlushMemTable(ColumnFamilyData* cfd) {
     if (shutting_down_.load(std::memory_order_acquire)) {
       return Status::ShutdownInProgress();
     }
+    if (cfd->IsDropped()) {
+      // FlushJob cannot flush a dropped CF, if we did not break here
+      // we will loop forever since cfd->imm()->NumNotFlushed() will never
+      // drop to zero
+      return Status::InvalidArgument("Cannot flush a dropped CF");
+    }
     bg_cv_.Wait();
   }
   if (!bg_error_.ok()) {