Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-63159

[Ephemeral] Backfill may miss purged deletes due to race at create

Details

    • 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

        For Gerrit Dashboard: MB-63159
        # Subject Branch Project Status CR V

        Activity

          People

            vesko.karaganev Vesko Karaganev
            vesko.karaganev Vesko Karaganev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty