MB-21109: Fix intermittent failure in 'temp item deletion' 37/69237/4
authorDave Rigby <daver@couchbase.com>
Wed, 26 Oct 2016 12:05:03 +0000 (13:05 +0100)
committerDave Rigby <daver@couchbase.com>
Tue, 1 Nov 2016 13:18:30 +0000 (13:18 +0000)
commit1e0e8ea7e91fdc9e1c68ed2b29dc16373c4062dc
treeb9067069bc9169be61473f2fb0aaa7f2fc681286
parent58acc666d78ca5524ff54fd6f5f4c067c7ba3726
MB-21109: Fix intermittent failure in 'temp item deletion'

Test suffers from intermittent failures due to it not accounting for
background fetch of deleted items. The issue is that the read of
curr_temp_items races with the background fetcher - if the background
fetcher has not completed then it will have a value of 1 (expected),
however if the BG fetcher completes before the stat is read then 0
will be returned (as the temp item has been cleaned up).

To address this, disable the reader threads before triggering the
background fetch. This requires that we manually handle the
EWOULDBLOCK that get_meta returns (otherwise we'll hang forever
waiting for the BG fetch task to run).

Change-Id: If1bca36a6517909259b4e3767fd58a7ff99944c3
Reviewed-on: http://review.couchbase.org/69237
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: buildbot <build@couchbase.com>
tests/ep_test_apis.cc
tests/ep_test_apis.h
tests/ep_testsuite_xdcr.cc