MB-24159: Fix segfault in ephemeral backfill 80/77780/15
authorJames Harrison <00jamesh@gmail.com>
Wed, 3 May 2017 12:38:07 +0000 (13:38 +0100)
committerDave Rigby <daver@couchbase.com>
Wed, 10 May 2017 16:40:47 +0000 (16:40 +0000)
commit526fb7a9b132b6aa64d79eb517b0b16610698dab
tree598edeec872e2c42d90803fa27613baf1c7fe59a
parenta6bf14f7fdb7142e10893b524bbb22995b7ffc4d
MB-24159: Fix segfault in ephemeral backfill

DCPBackfillMemory::run would segfault if the underlying rangeRead
returned no items.

This was because the front and back of the UniqueItemPtr vector were
unconditionally dereferenced even if non-existent. This was to call
getBySeqno().

This patch replaces these calls with the startSeqno and endSeqno
specified when the DCPBackfillMemory task was created. This is
consistent with the behaviour of DCPBackfillDisk.

Change-Id: I952a78ef3d931bc0832cfffb9e392b394d412fb3
Reviewed-on: http://review.couchbase.org/77780
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
src/dcp/backfill_memory.cc
src/ephemeral_vb.cc
src/ephemeral_vb.h
src/linked_list.cc
src/linked_list.h
src/seqlist.h
tests/module_tests/basic_ll_test.cc
tests/module_tests/dcp_test.cc
tests/module_tests/ephemeral_vb_test.cc