[SERVER-82970] Remove cursor cache from server as WiredTiger already caches cursor Created: 08/Nov/23  Updated: 19/Dec/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Chenhao Qu Assignee: Backlog - Storage Execution Team
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Documented
is documented by DOCS-16533 Investigate changes in SERVER-82970: ... Closed
Problem/Incident
Related
is related to WT-12153 Reduce overhead of cursor caching Backlog
Assigned Teams:
Storage Execution
Backwards Compatibility: Minor Change
Sprint: Execution Team 2023-12-11
Participants:
Linked BF Score: 135

 Description   

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.



 Comments   
Comment by Steven Vannelli [ 19/Dec/23 ]

Triage notes: Backlogging for now

Comment by Githook User [ 15/Dec/23 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: Revert "SERVER-82970 Remove cursor cache as WiredTiger also caches cursor"

This reverts commit df43e2e0a22d06299a85f5562be8639a8a11b2db.

GitOrigin-RevId: 1d54060c59760b618a7350da938bb65f38a46af6
Branch: master
https://github.com/mongodb/mongo/commit/50621e03e4c226ddd92828cd4e730fa060ed4865

Comment by Githook User [ 06/Dec/23 ]

Author:

{'name': 'Chenhao Qu', 'email': 'chenhao.qu@mongodb.com', 'username': 'quchenhao'}

Message: SERVER-82970 Remove cursor cache as WiredTiger also caches cursor

GitOrigin-RevId: ce1d3987d0b8b73e00f02a1117bc147539de6bf9
Branch: master
https://github.com/mongodb/mongo/commit/df43e2e0a22d06299a85f5562be8639a8a11b2db

Comment by Chenhao Qu [ 08/Nov/23 ]

agorrod Can you provide some background on this?

Generated at Thu Feb 08 06:50:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.