MB-23591: Re-instate isBucketDeletion check for flusher 86/76186/2 v4.6.2 v4.6.2-MP1 v4.6.2-MP2 v4.6.2-MP3
authorJim Walker <jim@couchbase.com>
Mon, 3 Apr 2017 08:58:38 +0000 (09:58 +0100)
committerDave Rigby <daver@couchbase.com>
Tue, 4 Apr 2017 07:51:39 +0000 (07:51 +0000)
The VBDeleteTask maybe scheduled to run, and isBucketDeletion
flag indicates if so, thus the flusher still needs to check
it to ensure no writes occur to a file that is about to be
deleted.

Change-Id: I746eb372f35c9b838dfab2ee7ac2b6c59606e94a
Reviewed-on: http://review.couchbase.org/76186
Well-Formed: Build Bot <build@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: David Haikney <david.haikney@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
src/ep.cc

index 3a776f5..04a7f6f 100644 (file)
--- a/src/ep.cc
+++ b/src/ep.cc
@@ -3341,6 +3341,13 @@ EventuallyPersistentStore::flushOneDelOrSet(const queued_item &qi,
     stats.dirtyAgeHighWat.store(std::max(stats.dirtyAge.load(),
                                          stats.dirtyAgeHighWat.load()));
 
+    // Wait until the VB is deleted before writing
+    if (vbMap.isBucketDeletion(qi->getVBucketId())) {
+        vb->rejectQueue.push(qi);
+        ++vb->opsReject;
+        return NULL;
+    }
+
     KVStore *rwUnderlying = getRWUnderlying(qi->getVBucketId());
     if (!deleted) {
         // TODO: Need to separate disk_insert from disk_update because