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

Shell ignores "opQueryOnly", "opCommandOnly" values for rpcProtocols option

    • Fully Compatible
    • ALL
    • Platform D (12/11/15)

      The shell ignores the "opQueryOnly" and "opCommandOnly" values for the --rpcProtocols option. When either of these options are passed, the shell treats them the same as the default option "all".

      Reproduce with the following script:

      db.runCommand("ping");
      var logs = db.adminCommand({getLog: "global"}).log;
      print(logs[logs.length - 1]);
      

      See the following shell session, which was run against a 3.2.0-rc4 mongod started with the -v option. Even though the "opQueryOnly" option was specified, the diagnostic log line for the command shows protocol:opCommand, which is unexpected.

      rassi@rassi:~/work/mongo$ mongo320rc4 --rpcProtocols opQueryOnly repro.js
      MongoDB shell version: 3.2.0-rc4
      connecting to: test
      2015-11-25T14:04:40.908-0500 I COMMAND  [conn2] command test.$cmd command: ping { ping: 1.0 } ntoreturn:1 ntoskip:0 keyUpdates:0 writeConflicts:0 numYields:0 reslen:22 locks:{} protocol:op_command 0ms
      

      See the following shell session, which was run against a 3.0.7 mongod started with the -v option. Even though the "opCommandOnly" option was specified, the diagnostic log line for the command shows the server as correctly having received the command request, which is unexpected.

      rassi@rassi:~/work/mongo$ mongo320rc4 --rpcProtocols opCommandOnly repro.js
      MongoDB shell version: 3.2.0-rc4
      connecting to: test
      2015-11-25T14:04:08.317-0500 I COMMAND  [conn2] command test.$cmd command: ping { ping: 1.0 } ntoreturn:1 keyUpdates:0 writeConflicts:0 numYields:0 reslen:37 locks:{} 0ms
      

      This is a regression introduced in 3.1.7 by 2a6a8f7c (SERVER-19376).

            Assignee:
            mira.carey@mongodb.com Mira Carey
            Reporter:
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: