MB-20716: Ensure DCP connections in EWOULDBLOCK are unpaused on bucket delete 69/67169/4
authorDave Rigby <daver@couchbase.com>
Tue, 30 Aug 2016 14:10:32 +0000 (15:10 +0100)
committerDave Rigby <daver@couchbase.com>
Tue, 30 Aug 2016 16:53:55 +0000 (16:53 +0000)
commit8734958cbfc7a326570ef415468934f1ba5ed5d4
tree25988269434b95b509c23a7da60245be4c7bc903
parentaab7a3319845b64fb75b9d47f0d79b6c4ebeb1aa
MB-20716: Ensure DCP connections in EWOULDBLOCK are unpaused on bucket delete

When a bucket delete occurs, memcached notifies the deleted engine via
the ON_DELETE_BUCKET callback, which in turn calls
DCPConnmap::shutdownAllConnections(). This correctly shuts down all
the DCP streams associated with DCP connections, however if any of
these DCP connections are in the EWOULDBLOCK state - i.e. the frontend
is waiting for a notify_IO_complete call to "wake" them up, then the
frontend will be blocked waiting for a notify_IO_complete which will
never arrive.

This behaviour is essentially a latent bug, however prior to the fix
for MB-20549, memcached would (incorrectly) call signalIfIdle on
connections in the EWOULDBLOCK state, forcing them to wake up. With
that fix in place this longer occurs.

The solution here is to explictly unpause all producer connections
when all streams are closed.

Change-Id: Ia105e78304f5481bb56a0c0ff1cfc973959e1016
Reviewed-on: http://review.couchbase.org/67169
Well-Formed: buildbot <build@couchbase.com>
Reviewed-by: Jim Walker <jim@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
src/connmap.cc
tests/module_tests/dcp_test.cc