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

Fix __wt_hs_upd_find wrongly returns WT_NOTFOUND

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • WT10.0.0, 4.9.0, 4.4.3
    • None
    • 3
    • Storage - Ra 2020-11-30

    Description

      History store update search (__wt_hs_upd_find) can wrongly return WT_NOTFOUND due to an unused local variable.

          if (ret == 0) {
              /* Couldn't find a record. */
              if (upd == NULL) {
                  ret = WT_NOTFOUND;
                  WT_STAT_CONN_INCR(session, cache_hs_read_miss);
                  WT_STAT_DATA_INCR(session, cache_hs_read_miss);
              } else {
                  WT_STAT_CONN_INCR(session, cache_hs_read);
                  WT_STAT_DATA_INCR(session, cache_hs_read);
              }
          }
      

      Here upd is initialized to NULL and never assigned apart from being used as a temporary variable when freeing the remaining modify updates.

      Attachments

        Issue Links

          Activity

            People

              chenhao.qu@mongodb.com Chenhao Qu
              chenhao.qu@mongodb.com Chenhao Qu
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: