MB-24246: update highestDedupedSeqno when an existing value is changed 79/77779/12
authorJames Harrison <00jamesh@gmail.com>
Fri, 5 May 2017 13:22:21 +0000 (14:22 +0100)
committerDave Rigby <daver@couchbase.com>
Wed, 10 May 2017 16:40:43 +0000 (16:40 +0000)
commita6bf14f7fdb7142e10893b524bbb22995b7ffc4d
tree647bcf5f757ae26e9b104d5c5e1686e4c53534c4
parent1c0333b5da2b7b63fe3b44289fca6a9b8952675c
MB-24246: update highestDedupedSeqno when an existing value is changed

Without this, rangeReads are allowed to stop "too early" - potentially
missing out on items that have been updated, i.e.,

^ = HDDS (HighestDedupedSeqno)

 A₁   B₂   C₃            Initial items
[A₁   B₂   C₃]           rangeRead 1-3
[A₁   B₂   C₃]  B'₄       Update B
 A₁   B₂   C₃   B'₄       RR ends
[A₁   B₂   C₃]  B'₄       new rangeRead, still consistent
 A₁   B₂   C₃   B'₄       RR ends
 A₁        C₃   B'₄       purger removes stale B
!A₁        C₃!  B'₄       RR 1-3 could be requested, but would be
inconsistent. The HDDS serves to extend the end of a rangeRead to the
most recently deduped item, in this case B' replaced an older B.

Currently, this updates the HDDS too soon in the case of a stale item,
forcing the rangeRead to include the new version immediately even though
the stale item is still present and would still allow a valid range.
This is to be improved in a coming patch, in which the TombstonePurger
will update the HDDS when removing the stale item.

Change-Id: If6c57a86bab56ccc007b0fe17c9229218bb0c2c7
Reviewed-on: http://review.couchbase.org/77779
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
src/ephemeral_vb.cc
src/linked_list.cc
src/linked_list.h
src/seqlist.h
tests/ep_testsuite_dcp.cc
tests/mock/mock_ephemeral_vb.h
tests/module_tests/basic_ll_test.cc
tests/module_tests/ephemeral_bucket_test.cc
tests/module_tests/ephemeral_vb_test.cc