[SERVER-23124] db.collection.count() returns -1 Created: 14/Mar/16 Updated: 16/Jul/19 Resolved: 16/Mar/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 3.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | airs0urce | Assignee: | Kelsey Schubert |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Steps To Reproduce: | Get dump of "swipes" collection from attached test.bson |
||||||||||||
| Participants: | |||||||||||||
| Description |
|
I have several collections in db. Mongo uses WiredTiger engine. then tried to run db.swipes.count() and it returned -1. Then I made dump of swipes collection on remote server: Downloaded, unpacked and tried to restore that collection on local machine: On remote and local machines I use Mongo 3.2.4. |
| Comments |
| Comment by airs0urce [ 16/Jul/19 ] | ||||||||
|
I was able to reproduce it on 4.0.10 and validate() fixed it btw: rs0:PRIMARY> db.error_log.count({}) , option to do more thorough scan." } | ||||||||
| Comment by Kelsey Schubert [ 16/Mar/16 ] | ||||||||
|
Hi airs0urce, Thank you for help investigating this issue. We are tracking this behavior in If you encounter this behavior in the future, I would recommend executing db.collection.validate() to correct the issue. Additional information about the behavior of count() can be found in our documentation here. Thank you, | ||||||||
| Comment by airs0urce [ 16/Mar/16 ] | ||||||||
|
Unfortunately now I can't as this is development server and somebody did some actions and added records in that collection. | ||||||||
| Comment by Kelsey Schubert [ 16/Mar/16 ] | ||||||||
|
Hi airs0urce, Can you please execute db.swipes.validate() and provide the output? Please confirm if the issue persists after validating the collection. Thank you, | ||||||||
| Comment by airs0urce [ 15/Mar/16 ] | ||||||||
|
Yes, it still returns -1. Note: I replaced db name by {DATABASE_NAME_HERE} | ||||||||
| Comment by Kelsey Schubert [ 14/Mar/16 ] | ||||||||
|
Hi airs0urce, Please include the --archive parameter when restoring the dump attached to this ticket:
I successfully started a mongod with files from your dbpath. However, I was unable to observe the issue you describe where db.swipes.count() returns -1. On my instance it consistently returned 0. Since I was unable to reproduce this issue with your dataset, I will need some more information to continue to investigate this behavior.
Thank you, | ||||||||
| Comment by airs0urce [ 14/Mar/16 ] | ||||||||
|
Thomas, Tried to upload, but no luck: https://dl.dropboxusercontent.com/u/1875424/Screen%20Shot%202016-03-15%20at%201.24.15%20AM.png Instead I uploaded "dbpath_archive_with_auth.txt". Inside this file you can see URL of gzipped dbpath folder. | ||||||||
| Comment by airs0urce [ 14/Mar/16 ] | ||||||||
|
Ok, packing dbpath folder, will upload after done. | ||||||||
| Comment by airs0urce [ 14/Mar/16 ] | ||||||||
|
> How did you remove the documents in the swipes collection? Also:
> Were there long running operations on the swipes collection when the documents were removed? eg. background index build? > Were there any unclean shutdowns or other errors logged by the server around this time? $ uptime > Have you manipulated (copied or moved) the underling database files? > If this node is part of a replica set, are other members affected? | ||||||||
| Comment by Kelsey Schubert [ 14/Mar/16 ] | ||||||||
|
Hi airs0urce, Additionally, can you please upload the dbpath of your remote server? I have created a secure upload portal. Files uploaded to this portal will only be visible to MongoDB employees investigating this issue and are routinely deleted after some time. Thank you, | ||||||||
| Comment by Kelsey Schubert [ 14/Mar/16 ] | ||||||||
|
Hi airs0urce, Thank you for opening this ticket. To get a better idea of what is going on here, please answer the following questions:
Kind regards, | ||||||||
| Comment by airs0urce [ 14/Mar/16 ] | ||||||||
|
I don't remove that collection from remote server for about next 15 hours. So if you need any additional information - I'm ready to help. |