[SERVER-4368] sharded count that has can't have results causes assertion WAS: "uncaught exception: count failed:" using sharded collections. | "db assertion failure" Created: 24/Nov/11  Updated: 16/Nov/21  Resolved: 21/Feb/12

Status: Closed
Project: Core Server
Component/s: Querying, Sharding
Affects Version/s: 2.0.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Yukihiko Sawanobori Assignee: Randolph Tan
Resolution: Duplicate Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 10.10
MongoDB 2.0.1

  • Sharding 6 replicaSets(2 datanodes + 1 arbiter / sets).

Issue Links:
Duplicate
duplicates SERVER-4554 shard selection code asserts for cert... Closed
Operating System: Linux
Participants:

 Description   

I would like to know the details about un error occurred when a `count` request is given to the sharded collections like below.

mongos:[2.0.1] > db.external_data.find({user_id: 8, checked_at: {$gte: 1320211921, $lte: 1320211421}}).count()
Tue Nov 22 20:36:33 uncaught exception: count failed: {
        "assertion" : "assertion s/commands_public.cpp:445",
        "errmsg" : "db assertion failure",
        "ok" : 0
}

It seems like this error occurs when `lte` is order than `gte`.
In this case the `count` request returns 0 or this error arbitrarily even if the query is not different.

// I get this error specially via mongoshell.

Regards,



 Comments   
Comment by Randolph Tan [ 21/Feb/12 ]

Fix on SERVER-4554 makes sure that at least one shard will be returned, which in effect, will not cause the assert to happen when the query has 0 results.

Comment by Yukihiko Sawanobori [ 25/Nov/11 ]

Thank you for your reply.

I will ignore this error for a while.

Comment by Eliot Horowitz (Inactive) [ 25/Nov/11 ]

Yes - the problem is that mongos isn't expecting the count() to have no possibility of returning results.

Correct fix is probably just to remove the assert

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