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

Tracking of data source statistics for cursor cache operations doesn't work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Needs Scheduling
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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.

      There are currently several test cases in test_cursor13.py and test_cursor16.py that have been relaxed or commented out because background operations on the history store cursor are getting included in the global cursor statistics.  In theory we could re-enable those tests by subtracting the file-level statistics for the history store from the global statistics.  But that requires fixing the issue described above.   See WT-6274 for details.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated: