MB-23795: Ephemeral Tombstone purging (VBucket-level) 08/76408/25
authorDave Rigby <daver@couchbase.com>
Thu, 6 Apr 2017 16:14:42 +0000 (17:14 +0100)
committerDave Rigby <daver@couchbase.com>
Thu, 13 Apr 2017 16:27:50 +0000 (16:27 +0000)
commit58b8ee8ff8264f7b145435b04600a8f3d4d2e52e
treeefd71d035cc0d25f294c92bd73418761f70df469
parent485a86ca13365110b428b4c4c36a19b5b53cefc5
MB-23795: Ephemeral Tombstone purging (VBucket-level)

Add Ephemeral Tombstone purging for Ephemeral VBuckets. This patch
adds two purge operations - one for the HashTable, and one for the
sequenceList:

a) The HashTable visitor (EphemeralVBucket::HTTombstonePurger) visits
   all items in the HashTable, and identifies any deletes which are
   old enough to be purged (age > ephemeral_metadata_purge_age). Such
   items are marked as stale, and transferred from the HashTable to
   the SequenceList.

b) The SequenceList purger (BasicLinkedList::purgeTombstones()) then
   iterates over the sequencelist, and hard-deletes any items marked
   stale - both Alive and Deleted items. It is at this stage that the
   OSVs are actually deleted.

   Note the SequenceList purging is somewhat delicate, to ensure
   correctness while not blocking front-end writes. See the inline
   comments in BasicLinkedList::purgeTombstones() for further details.

Note this isn't yet driven by any tasks - only by the unit
tests. Subsequent patches will connect into tasks.

Change-Id: I937ed23317826c84cbdd0bb0b3749a99ff446497
Reviewed-on: http://review.couchbase.org/76408
Reviewed-by: Jim Walker <jim@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
13 files changed:
CMakeLists.txt
src/ephemeral_tombstone_purger.cc [new file with mode: 0644]
src/ephemeral_tombstone_purger.h [new file with mode: 0644]
src/ephemeral_vb.cc
src/ephemeral_vb.h
src/linked_list.cc
src/linked_list.h
src/seqlist.h
tests/mock/mock_basic_ll.h
tests/mock/mock_ephemeral_vb.h
tests/module_tests/ephemeral_vb_test.cc
tests/module_tests/vbucket_test.cc
tests/module_tests/vbucket_test.h