MB-16500 [BP]: Removing unnecessary locking in consumer code 80/56080/3
authorabhinavdangeti <abhinav@couchbase.com>
Thu, 13 Aug 2015 18:46:35 +0000 (11:46 -0700)
committerabhinav dangeti <abhinav@couchbase.com>
Wed, 14 Oct 2015 18:26:38 +0000 (18:26 +0000)
commit6abf1790d0d6a167b3ff609fbf9c8c5da0f15d9e
tree590ec41381a7d0604aacb347359ef08c6aa74b70
parentd388995c85c0b00ca3a9b0d76a18a0b7a2086f6d
MB-16500 [BP]: Removing unnecessary locking in consumer code

streamMutex is to protect the ready list, but not the streams list.

The front end operations: addStream, closeStream, handleResponse, step
- wouldn't race with each other over the streams list, as multiple
memcached threads will not serve a single cookie.

The back end operations: processBufferedMessages (doesn't grab lock any
way), doRollback just read from streams list.

An addstream (front end op) is the only one that updates streams, and
this wouldn't update when a rollback is in progress.

Therefore, renaming the streamMutex lock in DCPConsumer to readyMutex
which is more apt for its operation - guarding the ready list.

Change-Id: Ia342d7243fef4b97b729aa94fdc64ad020711589
Reviewed-on: http://review.couchbase.org/54406
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Manu Dhundi <manu@couchbase.com>
Reviewed-on: http://review.couchbase.org/56080
Reviewed-by: Dave Rigby <daver@couchbase.com>
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: abhinav dangeti <abhinav@couchbase.com>
src/dcp-consumer.cc
src/dcp-consumer.h