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

Cursor total skipped less than 100 statistic is misleading

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • WT11.1.0, 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • 8
    • Storage Engines - 2022-10-31, Storage Engines - 2022-11-14

      The cursor statistic cursor_next_skip_lt_100 (same for cursor_prev_skip_lt_100) is somewhat misleading as we increment it when we skip 0 entries, it is unclear if this is intended or not as technically 0 is less than 100 but also it seems not meaningful to record when we don't skip any entries.

      The relevant code is here:

      err:
          if (total_skipped < 100)
              WT_STAT_CONN_DATA_INCR(session, cursor_next_skip_lt_100);
          else
              WT_STAT_CONN_DATA_INCR(session, cursor_next_skip_ge_100);
      
          WT_STAT_CONN_DATA_INCRV(session, cursor_next_skip_total, total_skipped);
      

      If total skipped is 0 is it clear we still increment the skip_lt_100 stat. The same functionality exists in cursor prev.

      The consensus in the comments means that we agree this should be fixed, the scope for fixing it will be:

      • Fix the relevant if checks to be if (total_skipped != 0 && total_skipped < 100). For both cursor_next and cursor_prev.
      • Fix broken tests that relied on those statistics. If too many tests break as a result then the ticket can be broken down further.

            Assignee:
            clarisse.cheah@mongodb.com Clarisse Cheah
            Reporter:
            luke.pearson@mongodb.com Luke Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: