Layered cursors tombstone ambiguity

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Btree
    • Storage Engines, Storage Engines - Transactions
    • None
    • None

      There's a comment in cursor_inline.h that mentions needing a tombstone with a special value to mark deleted records. The comment claims that if applications use the special value, then the only downside is that we'll do an unnecessary copy each time a new value is inserted.

      /*
       * We need a tombstone to mark deleted records, and we use the special value below for that purpose.
       * We use two 0x14 (Device Control 4) bytes to minimize the likelihood of colliding with an
       * application-chosen encoding byte, if the application uses two leading DC4 byte for some reason,
       * we'll do a wasted data copy each time a new value is inserted into the object.
       */
      static const WT_ITEM __wt_tombstone = {"\x14\x14", 2, NULL, 0, 0};
      

      But that's not obvious from the code – for example, when searching, we compare the found value to the tombstone, and return WT_NOTFOUND if it matches. This appears to be a bug.

      We should add tests to verify the claimed behaviour, and if it doesn't work as advertised, fix it.

      The documentation around this could also use some improvement:
      1. It's not currently obvious why the "compare the found value to the tombstone" thing works, so at the very least that needs to be clearer.
      2. It's also not clear why we need the in-band value in the first place, as opposed to a conventional out-of-band signal.

      Original PR link.

              Assignee:
              [DO NOT USE] Backlog - Storage Engines Team
              Reporter:
              Will Korteland
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: