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

Several eviction statistics misleading, they imply success, when they mean attempt

    • Storage Engines
    • 3
    • 2024-06-11 - Dinosaurs go rawr
    • Needed
    • Triage and Release

      Summary
      Eviction statistics could be misleading if eviction attempts fail.

      Offer

      If anyone wants to add statistics or logs related to eviction, add them to this branch, wt-8969-eviction-stats. I will handle the code review, and commit.

      Motivation
      Here is the code for __evict_page:

          /*
           * An internal session flags either the server itself or an eviction worker thread.
           */
          if (is_server)
              WT_STAT_CONN_INCR(session, cache_eviction_server_evicting);
          else if (F_ISSET(session, WT_SESSION_INTERNAL))
              WT_STAT_CONN_INCR(session, cache_eviction_worker_evicting);
          else {
              if (__wt_page_is_modified(ref->page))
                  WT_STAT_CONN_INCR(session, cache_eviction_app_dirty);
              WT_STAT_CONN_INCR(session, cache_eviction_app);
              cache->app_evicts++;
              time_start = WT_STAT_ENABLED(session) ? __wt_clock(session) : 0;
          }
      
       .....
          WT_WITH_BTREE(session, btree, ret = __wt_evict(session, ref, previous_state, flags));
       .....
      

      Several statistics being incremented there count the number of pages being evicted (application or worker threads or server, etc). But they imply that the pages actually evict. Whereas __wt_evict could potentially fail and mislead the interpretations being derived from FTDC. eg:

      "cache pages evicted by application threads" implies that these pages have been successfully evicted by the application thread. Whereas, since in this case, the pages actually failed the statistic is misleading. We should rename these bunch of statistics.

      • Does this affect any team outside of WT?
        Yes, TSEs or other engineers reading FTDC could be misled.
      • Is this issue urgent?
        No

      [Optional] Suggested Solution
      Rename statistics to imply attempt count rather than success. Can also add statistics around a failure count.

            Assignee:
            tod.johnson@mongodb.com Tod Johnson (Inactive)
            Reporter:
            sulabh.mahajan@mongodb.com Sulabh Mahajan
            Votes:
            0 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:
              Resolved: