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

Simplify __rec_row_zero_len

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Reconciliation
    • StorEng - Defined Pipeline

      /*
       * __rec_row_zero_len --
       *     Return if a zero-length item can be written.
       */
      static bool
      __rec_row_zero_len(WT_SESSION_IMPL *session, WT_TIME_WINDOW *tw)
      {
          /*
           * The item must be globally visible because we're not writing anything on the page. Don't be
           * tempted to check the time window against the default here - the check is subtly different due
           * to the grouping.
           */
          return (!WT_TIME_WINDOW_HAS_STOP(tw) &&
            ((tw->start_ts == WT_TS_NONE && tw->start_txn == WT_TXN_NONE) ||
              __wt_txn_tw_start_visible_all(session, tw)));
      }
      

      We need to review whether this can be simplified to:

      /*
       * __rec_row_zero_len --
       *     Return if a zero-length item can be written.
       */
      static bool
      __rec_row_zero_len(WT_SESSION_IMPL *session, WT_TIME_WINDOW *tw)
      {
          /*
           * The item must be globally visible because we're not writing anything on the page. Don't be
           * tempted to check the time window against the default here - the check is subtly different due
           * to the grouping.
           */
          return (!WT_TIME_WINDOW_HAS_STOP(tw) &&
              __wt_txn_tw_start_visible_all(session, tw));
      }
      

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            chenhao.qu@mongodb.com Chenhao Qu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: