MB-19843: Modify the end_seqno in DCP stream request after checking for rollback 96/64796/6
authorManu Dhundi <manu@couchbase.com>
Wed, 8 Jun 2016 19:41:12 +0000 (12:41 -0700)
committerDave Rigby <daver@couchbase.com>
Thu, 9 Jun 2016 16:22:11 +0000 (16:22 +0000)
commitde4b97c70147d1241cf1a0fc27e8eda09491a695
tree488547d7ec7fbdca652addc1fe25d0a4ee253c6d
parent597c65457a17254d2862aa18930a9c8a6fca5b92
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/64796
Well-Formed: buildbot <build@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
src/dcp-producer.cc
tests/ep_testsuite.cc