[SERVER-3678] Interrupted count query returns 0 as count result Created: 23/Aug/11  Updated: 15/Aug/12  Resolved: 14/Apr/12

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

Type: Bug Priority: Major - P3
Reporter: Lennart Koopmann Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux nb-lkoopmann 2.6.35-30-generic #56-Ubuntu SMP Mon Jul 11 20:01:08 UTC 2011 x86_64 GNU/Linux


Issue Links:
Duplicate
duplicates SERVER-5570 Killing of 'count' query cause incorr... Closed
Related
is related to SERVER-2291 count command returns zero in some er... Closed
Operating System: ALL
Participants:

 Description   

When interrupting a count query (for example in the mongo shell with killOp()) there is no exception raised but 0 returned as the count result. The count query should also raise an exception instead of returning 0, what might be interpreted as a valid result.

I performed these queries in the mongo shell and killed them in another shell - You can see the difference between all three types of queries:

> db.messages.distinct({foo : "bar"})
Tue Aug 23 18:51:00 uncaught exception: distinct failed: { "errmsg" : "exception: interrupted", "code" : 11601, "ok" : 0 }
> db.messages.find({foo : "bar"})    
error: { "$err" : "interrupted", "code" : 11601 }
> db.messages.count({foo : "bar"})
0



 Comments   
Comment by Scott Hernandez (Inactive) [ 14/Apr/12 ]

dup of SERVER-5570

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