Details
-
Bug
-
Resolution: Unresolved
-
Major - P3
-
None
-
3.2.16, 3.4.9, 3.5.13
-
Query Execution
-
ALL
-
(copied to CRM)
Description
The high-level command handling code always sets the namespace associated with an operation to the name of the database concatenated with the string "$cmd":
Commands which target a collection, in particular the various CRUD commands, will later overwrite this value to contain a fully qualified namespace such as myDb.myColl. However, if db.currentOp() is executed at the right time, the user might see a string such as myDb.$cmd:
...
|
"msg": "waiting for write concern",
|
"op": "command",
|
"numYields": 0,
|
"waitingForLock": false,
|
"ns": "myColl.$cmd",
|
...
|
This is a holdover from the legacy OP_QUERY-based commands protocol, in which a command over the myDb database would be issued with the namespace string myDb.$cmd. It is also counter-intuitive to users, who expect this field to always contain the fully-qualified namespace over which their application logically issued the operation. Instead of $cmd, the user should always see the actual collection name.