Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20263

Use maxWireVersion 5 for OP_COMMAND

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

      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:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: