[SERVER-26802] MongoCollection.Count() is not correct Created: 27/Oct/16 Updated: 27/Oct/16 Resolved: 27/Oct/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Hu | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Operating System: | ALL |
| Steps To Reproduce: | unzip the TestCSharp1812. |
| Participants: |
| Description |
|
I do not know how to reproduce the problem collection, I also send you the hardcopy of MongoBooster. |
| Comments |
| Comment by Hu [ 27/Oct/16 ] | ||
|
Great! | ||
| Comment by Stennie Steneker (Inactive) [ 27/Oct/16 ] | ||
|
Hi, Thank you for providing log files and a sample database to demonstrate the problem. From the log file it appears you had an unclean shutdown, which can result in WiredTiger collection counts being inaccurate. Fast collection counts in WiredTiger (i.e. counts without a query predicate) are only periodically persisted, so following an unclean shutdown you may need to validate the collection stats to true up counts: https://docs.mongodb.com/manual/reference/method/db.collection.count/#accuracy-after-unexpected-shutdown. For your specific case, you could run:
Additionally, I noticed you have disabled the journal which may result in some data modifications being lost in the event of unexpected shutdown: https://docs.mongodb.com/manual/core/wiredtiger/#storage-wiredtiger-journal. I would generally recommend leaving the journal enabled. Note: the SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion, please post on the mongodb-user group (https://groups.google.com/group/mongodb-user) or Stack Overflow with the mongodb tag. Regards, |