[SERVER-58352] Remove ClusterCursorManager::getNamespaceForCursorId(), and related simplifications Created: 07/Jul/21  Updated: 29/Oct/23  Resolved: 29/Oct/21

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

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: Neil Shweky (Inactive)
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: QE 2021-11-01
Participants:

 Description   

This is a pure refactor to simplify the ClusterCursorManager code.

The ClusterCursorManager historically has ensured that the namespace of a cursor can be inferred from its cursor id. This is done by allocating cursor ids such that cursors belonging to the same namespace share the same 32-bit cursor id prefix, and then internally maintaining a map from cursor id prefix to namespace. This map is used specifically to implement the getNamespaceForCursorId() method.

After we delete support for the legacy OP_KILL_CURSORS wire protocol op code, there will be only one remaining caller of getNamespaceForCursorId() in the code for the _killOperations command. This code is trying to kill all the cursors associated with a set of operation keys, which could be reimplemented to be achieved without using getNamespaceForCursorId(). In turn, this would allow us to delete getNamespaceForCursorId() and simplify the internals of the ClusterCursorManager to no longer maintain the map from cursor prefix to namespace.



 Comments   
Comment by Githook User [ 19/Nov/21 ]

Author:

{'name': 'Neil Shweky', 'email': 'neilshweky@gmail.com', 'username': 'Neilshweky'}

Message: SERVER-58352 cleanup some dead code
Branch: master
https://github.com/mongodb/mongo/commit/db2c8ad84ac7e91288a3226f98afc39ba188e2eb

Comment by Githook User [ 27/Oct/21 ]

Author:

{'name': 'Neil Shweky', 'email': 'neilshweky@gmail.com', 'username': 'Neilshweky'}

Message: SERVER-58352: Remove ClusterCursorManager::getNamespaceForCursorId(), and related simplifications
Branch: master
https://github.com/mongodb/mongo/commit/106b96548c5214a8e246a1cf6ac005a3985c16d4

Generated at Thu Feb 08 05:44:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.