MB-19843: Modify the end_seqno in DCP stream request after checking for rollback 06/64906/4
authorManu Dhundi <manu@couchbase.com>
Tue, 14 Jun 2016 18:05:04 +0000 (11:05 -0700)
committerManu Dhundi <manu@couchbase.com>
Tue, 14 Jun 2016 18:43:35 +0000 (18:43 +0000)
commit3e80a2b463793542f1f9448fb5baa6ef5c7cf882
tree76277a3fc4bda411829a0d4ef0ef286dcd20837f
parentb4007da6ceca5b2bb0902609d6e9c36f1f32e2a3
MB-19843: Modify the end_seqno in DCP stream request after checking for rollback

During a DCP stream request, we will update the end seqno when flags
DCP_ADD_STREAM_FLAG_LATEST/DCP_ADD_STREAM_FLAG_DISKONLY are used.
Currently in some cases when a rollback is required, the end_seqno could become
less than start_seqno before we check if a rollback is needed, resulting in
rejection of stream request.

Hence we should modify the end_seqno (if required as per the flags) only after
checking if a rollback is needed.

Change-Id: I23b112c16b9167023a990a5709ae6aae4838472e
Reviewed-on: http://review.couchbase.org/64906
Well-Formed: buildbot <build@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Manu Dhundi <manu@couchbase.com>
src/dcp-producer.cc
tests/ep_testsuite.cc