[SERVER-9811] Better error for query on the $cmd namespace without a limit of 1 Created: 29/May/13  Updated: 11/Jul/16  Resolved: 22/Jul/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.4.3
Fix Version/s: 2.5.2

Type: Bug Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Randolph Tan
Resolution: Done Votes: 1
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-9810 Assertion in mongos when running a co... Closed
Related
Operating System: ALL
Participants:

 Description   

Request::isCommand() checks if a query is actually a command. It does this by checking if the namespace end in "$cmd" AND if the limit of the query is 1 or -1. If the collection is "$cmd" but the limit is not 1 or -1, it just returns false and continues. This can cause problems later as a query on the $cmd namespace starts getting treated as a normal query instead.



 Comments   
Comment by auto [ 23/Jul/13 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@10gen.com'}

Message: SERVER-9811 Make sure to check for queries on special $cmd.sys namespace as well as normal commands
Branch: master
https://github.com/mongodb/mongo/commit/9fdbade1caa618f32016a19e4fb7ddd5475c59f9

Comment by auto [ 22/Jul/13 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-9811 Better error for query on the $cmd namespace without a limit of 1
Branch: master
https://github.com/mongodb/mongo/commit/dc6683226d664a38036382750c9776b3df894ca0

Comment by Spencer Brody (Inactive) [ 29/May/13 ]

See SERVER-9810 for one example of how this can go wrong, though I suspect there are other failure cases as well.

Generated at Thu Feb 08 03:21:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.