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

Refactor interface for row and column modify functions

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 5
    • StorEng - Defined Pipeline

      The current implementations of __wt_row_modify and __wt_col_modify include an optional additional argument bool restore in diagnostic mode.

      Based on a quick skim of the code there is no additional overhead for callers to know whether restore should be true or false, so it would be better to keep the HAVE_DIAGNOSTIC check inside the implementation of the two functions, rather than forcing callers to be aware of it.

      Doing so will probably require the use of WT_UNUSED(restore); to avoid a compiler warning in non-diagnostic builds.

      The new function definitions would become:

      int
      __wt_col_modify(WT_CURSOR_BTREE *cbt, uint64_t recno, const WT_ITEM *value, WT_UPDATE *upd_arg, u_int modify_type, bool exclusive, bool restore)
      
      int
      __wt_row_modify(WT_CURSOR_BTREE *cbt, const WT_ITEM *key, const WT_ITEM *value, WT_UPDATE *upd_arg, u_int modify_type, bool exclusive, bool restore)
      

      And all callers can have the duplicated calls deduplicated, and start always passing in the restore parameter.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            alexander.gorrod@mongodb.com Alexander Gorrod
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: