-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: JavaScript, Networking, Shell
-
Server Tooling & Methods
-
ALL
This ticket describes two issues with the "rpcProtocols" shell option:
- The shell option is not forwarded with startParallelShell().
- Connections created with MongoRunner do not respect the shell option.
The version of the shell in which this option was originally introduced (3.1.4) is affected by these issues.
See the following shell session, which reproduces issue #1. The shell was started with "--rpcProtocols opQueryOnly", and the server was started with "-v". The first "ping" command is correctly run with OP_QUERY, but the second is not.
> db.runCommand("ping") { "ok" : 1 } > startParallelShell("db.runCommand('ping')")(); 2015-12-07T17:18:37.906-0500 I - [thread1] shell: started program (sh19302): /home/rassi/work/mongo/mongo --host 127.0.0.1 --eval db = db.getSiblingDB('test');db.runCommand('ping') sh19302| MongoDB shell version: 0.0.0 sh19302| connecting to: 127.0.0.1:27017/test sh19302| { "ok" : 1 } 0 > db.adminCommand({getLog: "global"}).log.slice(-10) [ "2015-12-07T17:18:29.988-0500 I NETWORK [initandlisten] connection accepted from 127.0.0.1:41532 #1 (1 connection now open)", "2015-12-07T17:18:29.989-0500 I COMMAND [conn1] command admin.$cmd command: isMaster { isMaster: 1 } ntoreturn:1 ntoskip:0 keyUpdates:0 writeConflicts:0 numYields:0 reslen:178 locks:{} protocol:op_query 0ms", "2015-12-07T17:18:29.989-0500 I COMMAND [conn1] command test.$cmd command: listCollections { listCollections: 1.0, filter: {} } ntoreturn:1 ntoskip:0 keyUpdates:0 writeConflicts:0 numYields:0 reslen:205 locks:{ Global: { acquireCount: { r: 2 } }, MMAPV1Journal: { acquireCount: { r: 1 } }, Database: { acquireCount: { R: 1 } } } protocol:op_query 0ms", "2015-12-07T17:18:30.282-0500 I COMMAND [conn1] command test.$cmd command: listCollections { listCollections: 1.0, filter: {} } ntoreturn:1 ntoskip:0 keyUpdates:0 writeConflicts:0 numYields:0 reslen:205 locks:{ Global: { acquireCount: { r: 2 } }, MMAPV1Journal: { acquireCount: { r: 1 } }, Database: { acquireCount: { R: 1 } } } protocol:op_query 0ms", "2015-12-07T17:18:36.641-0500 I COMMAND [conn1] command test.$cmd command: ping { ping: 1.0 } ntoreturn:1 ntoskip:0 keyUpdates:0 writeConflicts:0 numYields:0 reslen:37 locks:{} protocol:op_query 0ms", "2015-12-07T17:18:37.977-0500 I NETWORK [initandlisten] connection accepted from 127.0.0.1:41533 #2 (2 connections now open)", "2015-12-07T17:18:37.977-0500 I COMMAND [conn2] command admin.$cmd command: isMaster { isMaster: 1 } ntoreturn:1 ntoskip:0 keyUpdates:0 writeConflicts:0 numYields:0 reslen:178 locks:{} protocol:op_query 0ms", "2015-12-07T17:18:37.978-0500 I COMMAND [conn2] command admin.$cmd command: whatsmyuri { whatsmyuri: 1 } ntoreturn:1 ntoskip:0 keyUpdates:0 writeConflicts:0 numYields:0 reslen:47 locks:{} protocol:op_command 0ms", "2015-12-07T17:18:37.979-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", "2015-12-07T17:18:37.980-0500 I NETWORK [conn2] end connection 127.0.0.1:41533 (1 connection now open)" ]
See the following shell session, which reproduces issue #2. The shell was started with "--rpcProtocols opQueryOnly", but the ping command is run with OP_COMMAND.
> var conn = MongoRunner.runMongod({verbose: ""}) Resetting db path '/data/db/mongod-20000' 2015-12-07T17:27:43.292-0500 I - [thread1] shell: started program (sh19456): /home/rassi/work/mongo/mongod --verbose --port 20000 --dbpath /data/db/mongod-20000 --setParameter enableTestCommands=1 2015-12-07T17:27:43.293-0500 W NETWORK [thread1] Failed to connect to 127.0.0.1:20000, reason: errno:111 Connection refused d20000| 2015-12-07T17:27:43.317-0500 I CONTROL [initandlisten] MongoDB starting : pid=19456 port=20000 dbpath=/data/db/mongod-20000 64-bit host=rassi ... ... d20000| 2015-12-07T17:27:43.402-0500 D STORAGE [initandlisten] looking up metadata for: local.startup_log @ RecordId(1) d20000| 2015-12-07T17:27:43.402-0500 I NETWORK [initandlisten] waiting for connections on port 20000 d20000| 2015-12-07T17:27:43.494-0500 I NETWORK [initandlisten] connection accepted from 127.0.0.1:43030 #1 (1 connection now open) d20000| 2015-12-07T17:27:43.494-0500 I COMMAND [conn1] command admin.$cmd command: isMaster { isMaster: 1 } ntoreturn:1 ntoskip:0 keyUpdates:0 writeConflicts:0 numYields:0 reslen:178 locks:{} protocol:op_query 0ms > conn.getDB("admin").runCommand("ping") d20000| 2015-12-07T17:28:01.342-0500 I COMMAND [conn1] command admin.$cmd command: ping { ping: 1.0 } ntoreturn:1 ntoskip:0 keyUpdates:0 writeConflicts:0 numYields:0 reslen:22 locks:{} protocol:op_command 0ms { "ok" : 1 }
See also related issue SERVER-21673.
- related to
-
SERVER-21673 Shell ignores "opQueryOnly", "opCommandOnly" values for rpcProtocols option
- Closed