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

Add of new prepare replaces unpersisted delete which exposes old document to bgfetch in FullEviction

    XMLWordPrintable

    Details

    • Triage:
      Triaged
    • Story Points:
      1
    • Is this a Regression?:
      Yes
    • Sprint:
      KV-Engine Sprint 2020-Dec, KV-Engine 2021-Jan

      Description

      In the VBucket::add code we allow an unpersisted delete to be replaced. If we replace an unpersisted delete with a committed item then all works fine as that item can be returned from the HashTable. If we replace an unpersisted delete with a prepare then a get finds no item in the HashTable and may queue a BgFetch which can return the document in its previous (undeleted) state.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          Hide
          ben.huddleston Ben Huddleston added a comment - - edited

          Ashwin Govindarajulu, repro steps:

          1. Add item for some key
          2. Stop persistence
          3. Delete item
          4. Do durable write with PersistMajority for same key
          5. Do get, should return the value from step 3, not the value from step 1 (i.e. it should be deleted)
          Show
          ben.huddleston Ben Huddleston added a comment - - edited Ashwin Govindarajulu , repro steps: Add item for some key Stop persistence Delete item Do durable write with PersistMajority for same key Do get, should return the value from step 3, not the value from step 1 (i.e. it should be deleted)
          Hide
          ashwin.govindarajulu Ashwin Govindarajulu added a comment -

          Verified the fix on 6.5.2-6617-enterprise.

          Closing the ticket.

          Show
          ashwin.govindarajulu Ashwin Govindarajulu added a comment - Verified the fix on 6.5.2-6617-enterprise. Closing the ticket.
          Hide
          build-team Couchbase Build Team added a comment -

          Build couchbase-server-7.0.0-4258 contains kv_engine commit 1228ca1 with commit message:
          MB-42918: Merge branch '6.5.2' into mad-hatter

          Show
          build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.0-4258 contains kv_engine commit 1228ca1 with commit message: MB-42918 : Merge branch '6.5.2' into mad-hatter
          Hide
          build-team Couchbase Build Team added a comment -

          Build couchbase-server-7.0.0-4258 contains kv_engine commit 9c481aa with commit message:
          [BP] MB-42918: Do not replace committed item with pending at add

          Show
          build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.0-4258 contains kv_engine commit 9c481aa with commit message: [BP] MB-42918 : Do not replace committed item with pending at add
          Hide
          ben.huddleston Ben Huddleston added a comment -

          Description for release notes:

          Summary: Known Issue If a durable write is performed via insert (Add) an existing item may be removed from the hash table if it was deleted and not yet persisted. Another client performing a get could trigger a fetch of the item from disk and the returned item could be the logical predecessor of the unpersisted delete that was removed from the hash table if it has not yet been persisted. This means that the client may not be able to read their own write.

          Workaround: Avoid use of insert (Add) with durable writes.

          Show
          ben.huddleston Ben Huddleston added a comment - Description for release notes: Summary: Known Issue If a durable write is performed via insert (Add) an existing item may be removed from the hash table if it was deleted and not yet persisted. Another client performing a get could trigger a fetch of the item from disk and the returned item could be the logical predecessor of the unpersisted delete that was removed from the hash table if it has not yet been persisted. This means that the client may not be able to read their own write. Workaround : Avoid use of insert (Add) with durable writes.

            People

            Assignee:
            ashwin.govindarajulu Ashwin Govindarajulu
            Reporter:
            ben.huddleston Ben Huddleston
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                  PagerDuty