[SERVER-46556] Inconstitent count and find results Created: 03/Mar/20 Updated: 27/Oct/23 Resolved: 04/Mar/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Sai Varun Reddy Daram | Assignee: | Dmitry Agranat |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Participants: |
| Description |
|
I have a mongo master and replica-set running in docker. I was doing a load test using JMeter using Golang as the server which writes to the database. In the middle of the load test, I pulled the plug (I mean literally). I turn the machine back on, login to the mongo console. I did a db.newCollection.count(), it resulted 2007. I did db.newCollection.remove({}), it said in the output " WriteResult({ "nRemoved" : 1767 }) " Then I did a db.newCollection.count(), it said 240. but, but, when I did a db.newCollection.find() it shows nothing.
I am attaching the screenshot below.
I have also attached the mongo logs below if that helps!
Host machine: OS. Ubuntu 16.04. CPU: Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz
Docker version: Client: Docker Engine - Community Server: Docker Engine - Community
Mongo Image Details: MongoDB shell version v4.2.2
|
| Comments |
| Comment by Sai Varun Reddy Daram [ 04/Mar/20 ] |
|
@Dmitry Agranat, snap! This can be closed then. |
| Comment by Dmitry Agranat [ 03/Mar/20 ] |
|
saivarunvishal@gmail.com, After an unclean shutdown of a mongod, count statistics reported by count() may be inaccurate as documented here. |