-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Component/s: Handshake
-
None
-
Needed
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.
- split to
-
NODE-6287 Remove Support for OP_QUERY
- Blocked