Details
-
Bug
-
Resolution: Unresolved
-
Major
-
7.6.0, 7.0.0, 7.1.0, 7.2.0, 7.2.1, 7.2.4, 7.2.2, 7.2.3, 7.2.5, 7.6.2, 7.2.6, 7.6.1
-
Untriaged
-
0
-
No
Description
This bug affects Ephemeral buckets only.
When a backfill is created, it should check that the purgeSeqno < startSeqno, to ensure that the client will not miss deletes.
Ephemeral buckets store changes in a linked list (the sequence list). Ranges of changes from this list can be locked (a read range) when they are needed for backfills.
In the backfill initialisation code in DCPBackfillMemoryBuffered::create, we create a read range (makeRangeIterator). This prevents tombstone purging. Then we check purgeSeqno < startSeqno.
When we do, we read the purgeSeqno from the VBucket object (VBucket::purgeSeqno), not from the LinkedList::getHighestPurgedDeletedSeqno and this is where the race can happen.
When tombstone purging occurs in EphemeralVBucket::purgeStaleItems, we call LinkedList::purgeTombstones(), which operates under the sequence list lock, but the update of the VBucket::purgeSeqno is not synchronised with that.
The backfill create can see the old purgeSeqno in this instance, and allow a backfill to be created which will miss deletes.
Attachments
Gerrit Reviews
For Gerrit Dashboard: MB-63159 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
214401,5 | MB-63159: Use the correct purgeSeqno in DCPBackfillMemoryBuffered | trinity | kv_engine | Status: MERGED | +2 | +1 |
215520,1 | Merge branch 'couchbase/trinity' into 'couchbase/cypher' | cypher | kv_engine | Status: MERGED | +2 | +1 |
215546,2 | Merge branch 'couchbase/cypher' into 'couchbase/master' | master | kv_engine | Status: ABANDONED | -1 | -1 |
215559,2 | Merge branch 'couchbase/cypher' into 'couchbase/master' | master | kv_engine | Status: MERGED | +2 | +1 |