Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-2944

Update handshake spec to allow using OP_MSG exclusively

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Component/s: Handshake
    • None
    • Needed
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      NODE-6287 Blocked
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion NODE-6287 Blocked

      Summary

      The handshake spec requires drivers to use OP_QUERY for the initial handshake if not connecting to a load balancer and not specifying an API version:

      If server API version is not requested and loadBalanced: False, drivers MUST use legacy hello for the first message of the initial handshake with the OP_QUERY protocol (before switching to OP_MSG if the maxWireVersion indicates compatibility), and include helloOk:true in the handshake request.

      With support for MongoDB 3.4 gone, we now only support servers that support OP_MSG. The handshake spec should thus be updated:

      • Suggest that drivers SHOULD use OP_MSG if their minWireVersion is 6 (MongoDB 3.6) or higher
      • If the server does not understand OP_MSG, drivers MUST show the same error message as when wire version checks fail (e.g. because the server's maxWireVersion is lower than the driver's minWireVersion).

      Motivation

      The initial handshake is the only place where OP_QUERY is still used; all subsequent operations (e.g. findOne/find operations, command executions, and hello calls for monitoring) will always use OP_MSG as every server we connect to supports it. Making this spec change would thus allow drivers to remove their legacy OP_QUERY logic entirely and only support OP_MSG going forward.

      Furthermore, the server still supports OP_QUERY due to drivers sending the initial handshake with that opcode. Once the change is rolled out across all drivers, we can start the process of deprecating OP_QUERY to eventually remove it from the server.

            Assignee:
            Unassigned Unassigned
            Reporter:
            andreas.braun@mongodb.com Andreas Braun
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: