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

Change AsyncDBClient to use OP_MSG for isMaster request rather than OP_QUERY

    • 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-10-18

      Historically, clients have always issued the isMaster request on connection open as an OP_QUERY command. This was necessary for communication with older servers that do not support the OP_MSG protocol. However, as part of SERVER-58338 we changed DBClientConnection to use OP_MSG rather than OP_QUERY to issue its isMaster or hello request on connection open. This is acceptable because neither the deprecated mongo shell, nor a 5.1 mongod or mongos, needs to be able to communicate with old servers that don't support OP_MSG. Furthermore, this change aligns with the broader effort to remove support for op codes other than OP_MSG. OP_INSERT, OP_DELETE, OP_UPDATE, OP_KILL_CURSORS, and OP_GET_MORE or no longer supported in the master branch. OP_QUERY finds are also no longer supported. However, as of this writing the server retains minimal support for a handful of allowlisted OP_QUERY commands, including isMaster and hello.

      The change from SERVER-58338 did not affect the AsyncDBClient, which continues to have special logic for issuing its isMaster command as an OP_QUERY command. In order to continue the effort to remove OP_QUERY from the code base, and in order to bring the AsyncDBClient in line with the other client code in the server code base, we should change the AsyncDBClient to issue its isMaster/hello as an OP_MSG command.

      Note that compared the internal client code in the server, the drivers have stricter backwards compatibility and usability requirements. Therefore, the drivers will continue, at least for now, to use OP_QUERY for the initial isMaster command.

            david.storch@mongodb.com David Storch
            david.storch@mongodb.com David Storch
            0 Vote for this issue
            2 Start watching this issue