Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-512

LSM code checking WT_CURSTD_OVERWRITE

    • Type: Icon: Task Task
    • Resolution: Done
    • WT1.6.3
    • Affects Version/s: None
    • Component/s: None

      Alex, I didn't want to forget this one, so I'm opening an issue.

      I'm confused why *clsm_update and *clsm_remove check the cursor's WT_CURSTD_OVERWRITE flag.

      The code in each that does:

              if (F_ISSET(cursor, WT_CURSTD_OVERWRITE) ||
                  (ret = __clsm_search(cursor)) == 0)
      

      should maybe be:

              if ((ret = __clsm_search(cursor)) == 0)
      

      but that's bad for __clsm_remove, because LSM searches are more expensive.

      Is there a reason we can't change the semantics of WT_CURSOR::remove to ignore the possibility the key doesn't exist, and then LSM doesn't have to do a search first.

      If that isn't OK, we could at least make that the default and add a new config option to return failure if the key doesn't exist?

      This isn't an issue for the Basho/Riak tests, I'm told all of its get/put/del cursors are setting overwrite.

            Assignee:
            michael.cahill@mongodb.com Michael Cahill (Inactive)
            Reporter:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: