Use maxWireVersion 5 for OP_COMMAND

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Networking, Querying
    • None
    • Sharding
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            [DO NOT USE] Backlog - Sharding Team
            Reporter:
            A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: