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

Fix __wt_hs_upd_find wrongly returns WT_NOTFOUND

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT10.0.0, 4.9.0, 4.4.3
    • Affects Version/s: None
    • Component/s: None
    • 3
    • Storage - Ra 2020-11-30

      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.

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

              Created:
              Updated:
              Resolved: