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

Skip deleting updates in the history store if all the records in the history store are obsolete

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT10.0.1, 4.4.9, 5.0.3, 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • 3
    • Storage - Ra 2021-09-06

      When we are deleting the history store record in reconciliation, we search the history store with WT_CURSTD_HS_READ_ALL flag. This will return the history store record that are actually obsolete. If we see such record, we should continue until we see an non-obsolete record. If all the updates are obsolete, we should do nothing and return successfully.

          hs_cursor->set_key(hs_cursor, 3, btree_id, key, ts);
          F_SET(hs_cursor, WT_CURSTD_HS_READ_ALL);
          WT_ERR_NOTFOUND_OK(__wt_curhs_search_near_after(session, hs_cursor), true);
          /* Empty history store is fine. */
          if (ret == WT_NOTFOUND) {
              ret = 0;
              goto done;
          } else {
              WT_ERR(hs_cursor->get_key(hs_cursor, &hs_btree_id, &hs_key, &hs_ts, &hs_counter));
              ++hs_counter;
          }
      

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

              Created:
              Updated:
              Resolved: