Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-82970

Remove cursor cache from server as WiredTiger already caches cursor

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Execution Team 2023-12-11
    • 135

      I noticed that there is also a cursor cache in server.

      WT_CURSOR* WiredTigerSession::getCachedCursor(uint64_t id, const std::string& config) {
          // Find the most recently used cursor
          for (CursorCache::iterator i = _cursors.begin(); i != _cursors.end(); ++i) {
              // Ensure that all properties of this cursor are identical to avoid mixing cursor
              // configurations. Note that this uses an exact string match, so cursor configurations with
              // parameters in different orders will not be considered equivalent.
              if (i->_id == id && i->_config == config) {
                  WT_CURSOR* c = i->_cursor;
                  _cursors.erase(i);
                  _cursorsOut++;
                  return c;
              }
          }
          return nullptr;
      }
      

      Given that we already have a cursor cache in WiredTiger. I feel this is inefficient and we are duplicating our effort.

      Review the background why we do this in server and whether it is beneficial to remove the cache from server and let WiredTiger to handle the cursor cache.

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            chenhao.qu@mongodb.com Chenhao Qu
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: