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

__cursor_enter should ignore the return code of __wt_evict_app_assist_worker_check rather than returning it.

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Cache and Eviction
    • Storage Engines
    • 1
    • StorEng - Defined Pipeline

      Check uses of the "busy" argument to __wt_evict_app_assist_worker_check across codebase and the use of its return value.

      • __cursor_enter should ignore the return code of __wt_evict_app_assist_worker_check rather than returning it:
          if (session->ncursors == 0)
              WT_RET(__wt_evict_app_assist_worker_check(session, false, false, NULL));
      
      • __wt_cursor_func_init forwards the return code - does it need to do it?
          /* If the transaction is idle, check that the cache isn't full. */
          WT_RET(__wt_txn_idle_cache_check(session));
      
      • In __wt_txn_idle_cache_check:
          /*
           * Check the published snap_min because read-uncommitted never sets WT_TXN_HAS_SNAPSHOT. We
           * don't have any transaction information at this point, so assume the transaction will be
           * read-only. The dirty cache check will be performed when the transaction completes, if
           * necessary.
           */
          if (F_ISSET(txn, WT_TXN_RUNNING) && !F_ISSET(txn, WT_TXN_HAS_ID) &&
            __wt_atomic_loadv64(&txn_shared->pinned_id) == WT_TXN_NONE)
              WT_RET(__wt_evict_app_assist_worker_check(session, false, true, NULL));
      
      • Check if __wt_txn_begin has to use "true" for the "busy" argument since it requires some eviction to happen:
              /*
               * Stall here if the cache is completely full. Eviction check can return rollback, but the
               * WT_SESSION.begin_transaction API can't, continue on.
               */
              WT_RET_ERROR_OK(
                __wt_evict_app_assist_worker_check(session, false, true, NULL), WT_ROLLBACK);
      
      • Check if __wt_compact needs the "busy" argument to be true or false and if the return value needs to be ignored:
              /*
               * Compact pulls pages into cache during the walk without checking whether the cache is
               * full. Check now to throttle compact to match eviction speed.
               */
              WT_ERR(__wt_evict_app_assist_worker_check(session, false, false, &eviction_happened));
      

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            y.ershov@mongodb.com Yury Ershov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: