[SERVER-2291] count command returns zero in some error cases rather than reporting an error with ok:false Created: 27/Dec/10  Updated: 12/Jul/16  Resolved: 17/Jun/12

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 2.1.2

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-5570 Killing of 'count' query cause incorr... Closed
is depended on by SERVER-2222 notablescan mode neglects to fail som... Backlog
Related
related to SERVER-3678 Interrupted count query returns 0 as ... Closed
Participants:

 Description   

if ( !res->complete() )

{ log() << "Count with ns: " << ns << " and query: " << query << " failed with exception: " << res->exception() << endl; return 0; }

If none of the query plans were successful, runCount() returns a count of zero and this is forwarded by the count command implementation. This may be very old behavior predating the current query optimizer so if we change this it might be prudent to do so carefully.



 Comments   
Comment by auto [ 17/Jun/12 ]

Author:

{u'date': u'2012-06-17T06:37:46-07:00', u'email': u'eliot@10gen.com', u'name': u'Eliot Horowitz'}

Message: SERVER-2291 - more count fixes
Branch: master
https://github.com/mongodb/mongo/commit/332d3c2060ae825a64542255603be8ee04bc7f72

Comment by auto [ 17/Jun/12 ]

Author:

{u'date': u'2012-06-16T18:04:35-07:00', u'email': u'eliot@10gen.com', u'name': u'Eliot Horowitz'}

Message: SERVER-2291 - make count fail rather than return 0 in certain cases
Branch: master
https://github.com/mongodb/mongo/commit/e9faeb930edfc3920fbcc4a0f06a491f348f1084

Comment by auto [ 31/Jan/11 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: fix spurious timeout kills causing slowdown in mr_killop, caused by additional object in collection and SERVER-2291
https://github.com/mongodb/mongo/commit/6797df01a30ee2491a4be36a4528153fa863b521

Generated at Thu Feb 08 02:59:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.