-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Component/s: Handshake
-
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.
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 and OP_REPLY 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.
Acceptance Criteria
With support for MongoDB 3.4 gone, we now only support servers that support OP_MSG. The handshake spec should thus be updated:
- Drivers MUST use OP_MSG if their minWireVersion is 6 (MongoDB 3.6) or higher (which is all drivers now!)
- is related to
-
JAVA-5865 When connecting to a 3.4 server, driver throws MongoTimeoutException from server selection
-
- Closed
-
-
DRIVERS-2783 Test that LoadBalanced connection handshake uses OP_MSG
-
- Backlog
-
-
NODE-6672 Remove OpQuery handling in command monitoring helpers
-
- Backlog
-
-
DRIVERS-2127 Clarify if OP_QUERY should always be used for monitoring and/or initial handshake
-
- Backlog
-
- related to
-
DRIVERS-3497 Spec analysis: mongodb-handshake — missing tests, ambiguities, inconsistencies
-
- Backlog
-
- split to
-
CSHARP-5865 Update handshake spec to allow using OP_MSG exclusively
-
- Backlog
-
-
RUBY-3766 Update handshake spec to allow using OP_MSG exclusively
-
- Backlog
-
-
JAVA-6088 Update handshake spec to allow using OP_MSG exclusively
-
- Backlog
-
-
NODE-6287 Remove Support for OP_QUERY
-
- Backlog
-
-
CDRIVER-6231 Update handshake spec to allow using OP_MSG exclusively
-
- Backlog
-
-
CXX-3412 Update handshake spec to allow using OP_MSG exclusively
-
- Backlog
-
-
GODRIVER-3807 Update handshake spec to allow using OP_MSG exclusively
-
- Backlog
-
-
PHPLIB-1780 Update handshake spec to allow using OP_MSG exclusively
-
- Blocked
-
-
PYTHON-5713 Update handshake spec to allow using OP_MSG exclusively
-
- Closed
-
-
RUST-2355 Update handshake spec to allow using OP_MSG exclusively
-
- Closed
-