DRIVERS-2944 Update handshake spec to allow using OP_MSG exclusively#1933
Conversation
|
removed @blink1073 (OOO currently) and requested @vbabanin instead :) |
| # Use OP_MSG for all future commands, including authentication. | ||
| conn.supports_op_msg = True | ||
| if reply["maxWireVersion"] < 6: | ||
| # Server is reporting that it doesn't support OpMSG |
There was a problem hiding this comment.
See above. The server "reports" it doesn't support OpMSG by hanging up the socket.
| handshake using `OP_MSG` if an API version was declared on the client. | ||
|
|
||
| If no API version was declared, drivers that have historically supported MongoDB 3.4 and earlier MUST perform the | ||
| If no API version was declared, drivers that have historically supported MongoDB 3.4 and earlier MAY perform the |
There was a problem hiding this comment.
I feel like this historical distinction is now irrelevant. Should we instead just say that drivers SHOULD use OP_MSG for the handshake, and MUST if load balanced mode is on or API version is specified?
Alternatively, we can just link to the handshake spec since this is duplicating what is already says there.
There was a problem hiding this comment.
I like the idea of linking to the handshake spec!
| `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. | ||
| Drivers SHOULD use the `OP_MSG` protocol for all handshakes if their minWireVersion is 6 (MongoDB 3.6) or higher. If a |
There was a problem hiding this comment.
What's the justification for SHOULD rather than MUST? Is there a reason for any driver not to do this?
There was a problem hiding this comment.
tbh i wrote SHOULD because that's what the driver ticket said https://jira.mongodb.org/browse/DRIVERS-2944
(And I justified it to myself by saying that if a driver doesn't do this they're just doing the current behaviour which isn't inherently breaking anything?)
nbbeeken
left a comment
There was a problem hiding this comment.
🎉 its happeninggggg!!!! exciting times 😁
Co-authored-by: Jeff Yemin <jeff.yemin@mongodb.com>
jyemin
left a comment
There was a problem hiding this comment.
OP_QUERY is dead! Long live OP_MSG!
Oh also, LGTM.
|
Bypassing and merging because @jyemin is one of the |
Please complete the following before merging:
Python driver PR: PYTHON-5713 Allow using OP_MSG exclusively mongo-python-driver#2799
clusters).