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

Cursor cache statistics not getting incremented

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • WT10.0.0, 4.4.2, 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • None

      The cursor_cache statistic tracks the number of times we add cursors to the cursor cache. In the per-data-source statistics, however, this value is always zero.

      The problem is in wt_cursor_cache_release():

       

          WT_ERR(cursor->cache(cursor));
          WT_STAT_CONN_INCR(session, cursor_cache);
          WT_STAT_DATA_INCR(session, cursor_cache);
      

      The call to cursor->cache releases the dhandle, setting session->dhandle to NULL. As a result, WT_STAT_DATA_INCR doesn't have a dhandle to update.

      A simple fix would be to move the stats before the call to cursor->cache. We'd wind up over counting in error cases, but that would be better than not counting anything.

            Assignee:
            keith.smith@mongodb.com Keith Smith
            Reporter:
            keith.smith@mongodb.com Keith Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: