MB-20943: Set state to dead when deleting vbucket 73/67873/8 4.5.1 v4.5.1
authorDaniel Owen <owend@couchbase.com>
Wed, 21 Sep 2016 09:50:33 +0000 (10:50 +0100)
committerDave Rigby <daver@couchbase.com>
Wed, 21 Sep 2016 16:29:44 +0000 (16:29 +0000)
commite9a655b49393e1302bf75aa759b11969545c986a
treed1a0b33c70e33a0124c05017d4281a599fdac877
parentd5be16381fd8568fb8ccac0d92b4cf48d6cf880a
MB-20943: Set state to dead when deleting vbucket

When executing the VBucketMemoryDeletionTask the vbucket state is
unchanged.  notifyAllPendingConnsFailed is called in the run
function of VBucketMemoryDeletionTask.  This inturn calls fireAllOps,
which ensures all pending ops are cleared if the vbucket is in an
active state.

However if the vbucket is in a pending state is does nothing and
therefore the pending operations remain.  This results in connections
not being closed down.

The solution provided is to set the vbucket state to dead in
deleteVBucket, prior to calling scheduleVBDeletion.

A corresponding test has been added, which without the fix will hang.

Change-Id: I09cd4597b26576dd4b99d26f3a60c031e1b5f41d
Reviewed-on: http://review.couchbase.org/67873
Well-Formed: buildbot <build@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Reviewed-by: Jim Walker <jim@couchbase.com>
src/ep.cc
src/vbucket.cc
tests/ep_testsuite.cc