[SERVER-20263] Use maxWireVersion 5 for OP_COMMAND Created: 02/Sep/15  Updated: 06/Dec/22  Resolved: 02/Jun/16

Status: Closed
Project: Core Server
Component/s: Networking, Querying
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding
Participants:

 Description   

If I interpret [this comment|https://github.com/mongodb/mongo/blob/dd15f9c211f5bc40b6fa8a7cd44350d3aeb87d89/src/mongo/db/wire_version.h#L59} correctly:

enum WireVersion {
    // ... <snip> ...
    // Support find and getMore commands, as well as OP_COMMAND in mongod (but not mongos).
    FIND_COMMAND = 4,
};

... then we can use wire version to know whether find and getMore commands will succeed, but we can't use wire version to know whether OP_COMMAND will succeed. Instead, we must do something like

if maxWireVersion >= 4 and "msg: isdbgrid" not in ismaster response:
    use OP_COMMAND

That seems needlessly inelegant. Let's bump maxWireVersion to 5 if and only if OP_COMMAND is supported.



 Comments   
Comment by Andy Schwerin [ 02/Jun/16 ]

OP_CMD remains only for use in communication among cluster members, so clients should not at present attempt to use OP_CMD regardless of wire version.

Comment by David Storch [ 02/Sep/15 ]

Yes, my understanding is that drivers should not implement OP_COMMAND for 3.2 and also that we will bump the wire version when we have full, no-longer-experimental OP_COMMAND support.

Comment by A. Jesse Jiryu Davis [ 02/Sep/15 ]

By experimental feature, you mean drivers won't actually use it? In that case we can let this be until we decide that drivers do use it, at which point I'd request a wire version bump.

Comment by David Storch [ 02/Sep/15 ]

jesse, my understanding is the same as yours. I believe the thinking is that since OP_COMMAND is an experimental feature, drivers won't have to do the inelegant wire version + isdbgrid check. I guess we also deem it unnecessary to bump the wire version for an experimental feature.

Generated at Thu Feb 08 03:53:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.