[SERVER-24079] Different result between db.count and db.find Created: 06/May/16  Updated: 10/May/16  Resolved: 10/May/16

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

Type: Bug Priority: Critical - P2
Reporter: Pierre MOELO [X] Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-3645 Sharded collection counts (on primary... Closed
Operating System: ALL
Participants:

 Description   

Hi Team,

I have a very weird problem, when I run db.count the command returns 2 but when I run db.find the command returns only one.

mongos> db.xxx.count({ "_id" : "xxx1787319235"});
2
mongos> db.xxx.find({ "_id" : "xxx1787319235"}, {yyy:1});
{ "_id" : "xxx1787319235", "yyy" : "1e1805a52ef44173233082e34e4175df07288f2ea0928a5e05217a9d969a2ef3" }



 Comments   
Comment by Kelsey Schubert [ 10/May/16 ]

Hi PM,

SERVER-3645 fix version is "planned but not scheduled," which indicates that it is not being actively worked on, but may be scheduled in the future. We are aware that this issue may impact a number of users and have included notes in our documentation that describe this behavior and offer a work around.

Thank you for your help identifying the root cause of this issue,
Thomas

Comment by Pierre MOELO [X] [ 09/May/16 ]

Hi @Thomas

I confirm that we are on a sharded cluster.
No update for SERVER-3645 since November 2015 ?

Thank you,

Comment by Kelsey Schubert [ 06/May/16 ]

Hi PM,

Can you please confirm you are observing this behavior on a sharded cluster?

If so, I think this issue is a duplicate of SERVER-3645, where the count command does not filter out unowned documents and returns a larger value than a normal query would. Please feel to vote for SERVER-3645 and watch it for updates.

Thank you,
Thomas

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