Update handshake spec to allow using OP_MSG exclusively

XMLWordPrintableJSON

    • Needed
    • Hide

      Summary of necessary driver changes

      •  

      Commits for syncing spec/prose tests
      (and/or refer to an existing language POC if needed)

      •  

      Context for other referenced/linked tickets

      •  
      Show
      Summary of necessary driver changes   Commits for syncing spec/prose tests (and/or refer to an existing language POC if needed)   Context for other referenced/linked tickets  
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      NODE-6287 Blocked
      CDRIVER-6231 Blocked
      CXX-3412 Blocked
      CSHARP-5865 Blocked
      GODRIVER-3807 Blocked
      JAVA-6088 Blocked
      PYTHON-5713 Blocked
      PHPLIB-1780 Blocked
      RUBY-3766 Blocked
      RUST-2355 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 */ } #scriptField td.willNotDo { background-color: #FF0000; /* Red color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion NODE-6287 Blocked CDRIVER-6231 Blocked CXX-3412 Blocked CSHARP-5865 Blocked GODRIVER-3807 Blocked JAVA-6088 Blocked PYTHON-5713 Blocked PHPLIB-1780 Blocked RUBY-3766 Blocked RUST-2355 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:
            Iris Ho
            Reporter:
            Andreas Braun
            Jib Adegunloye Jib Adegunloye
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: