Make overwrite=true suppress WT_NOTFOUND on WT_CURSOR::remove for standard (non-layered) cursors

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Engines - Transactions
    • 397.202
    • SE Transactions - 2026-08-14
    • 3

      Background

      WT-17254 makes a layered follower cursor's remove skip the stable lookup and report success on an already-deleted/nonexistent key when overwrite=true (the default), instead of WT_NOTFOUND. That only applies to layered cursors.

      For a standard WT_CURSOR on a plain btree, overwrite currently has no effect on remove at all: WT_CURSOR::remove always fails with WT_NOTFOUND if the key doesn't exist or is already deleted, regardless of overwrite.

      Proposal

      Extend overwrite=true to also apply to WT_CURSOR::remove on standard cursors: removing a key that doesn't exist, or that is already deleted, should return success (a no-op) rather than WT_NOTFOUND, consistent with how overwrite=true already relaxes insert (no WT_DUPLICATE_KEY) and update (no WT_NOTFOUND) against the existing-record check.

      Considerations

      • This is a documented, public API behavior change for WT_CURSOR::remove – needs a compatibility/documentation review, and likely a version-gated rollout.
      • test/format performs unvalidated random removes and currently expects WT_NOTFOUND on a missing key in some paths; those call sites would need auditing since they would no longer see that error with overwrite=true (the default).
      • Related discussion in WT-17254 (layered-cursor-only version of this behavior) and Keith Smith's comments there arguing overwrite should describe caller-visible behavior uniformly across insert/update/remove rather than being implementation-specific.

      See WT-17254 for the layered-cursor precedent.

            Assignee:
            [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            Haribabu Kommi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: