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

    • Triaged
    • 1
    • Yes
    • 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

          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)
          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)

          Verified the fix on 6.5.2-6617-enterprise.

          Closing the ticket.

          ashwin.govindarajulu Ashwin Govindarajulu added a comment - Verified the fix on 6.5.2-6617-enterprise. Closing the ticket.

          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

          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

          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

          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

          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.

          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

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                PagerDuty