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

Remove ClusterCursorManager::getNamespaceForCursorId(), and related simplifications

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.2.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • QE 2021-11-01

      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.

            neil.shweky@mongodb.com Neil Shweky (Inactive)
            david.storch@mongodb.com David Storch
            0 Vote for this issue
            3 Start watching this issue