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

Update the statistics cache_hs_insert with a value instead of increments

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • WT11.0.0, 5.3.0
    • Affects Version/s: None
    • Component/s: None
    • 2

      In hs_rec.c, we increment the statĀ cache_hs_insert insideĀ the hs_insert_record function by doing the following:

      WT_STAT_CONN_DATA_INCR(session, cache_hs_insert); 

      Instead, we should consider updating the stat outside this function, i.e in wt_hs_insert_updates, and use the following:

      WT_STAT_CONN_DATA_INCRV(session, cache_hs_insert, insert_cnt); 

      This would reduce the number of calls related to this stat.

      Suggested solution:

      diff --git a/src/history/hs_rec.c b/src/history/hs_rec.c
      index 0e7e6dd2e..5df5f75f9 100644
      --- a/src/history/hs_rec.c
      +++ b/src/history/hs_rec.c
      @@ -241,7 +241,6 @@ __hs_insert_record(WT_SESSION_IMPL *session, WT_CURSOR *cursor, WT_BTREE *btree,
           cursor->set_value(
             cursor, tw, tw->durable_stop_ts, tw->durable_start_ts, (uint64_t)type, hs_value);
           WT_ERR(cursor->insert(cursor));
      -    WT_STAT_CONN_DATA_INCR(session, cache_hs_insert);
       
       err:
           if (!hs_read_all_flag)
      @@ -774,6 +773,8 @@ err:
       
           WT_TRET(hs_cursor->close(hs_cursor));
       
      +    /* Update history store related stats. */
      +    WT_STAT_CONN_DATA_INCRV(session, cache_hs_insert, insert_cnt);
           WT_STAT_CONN_DATA_INCRV(session, cache_hs_insert_full_update, cache_hs_insert_full_update);
           WT_STAT_CONN_DATA_INCRV(
             session, cache_hs_insert_reverse_modify, cache_hs_insert_reverse_modify); 

            Assignee:
            etienne.petrel@mongodb.com Etienne Petrel
            Reporter:
            etienne.petrel@mongodb.com Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: