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

Remove ClusterCursorManager::getNamespaceForCursorId(), and related simplifications

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 5.2.0
    • None
    • Fully Compatible
    • QE 2021-11-01

    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.

      Attachments

        Activity

          People

            neil.shweky@mongodb.com Neil Shweky
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: