[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: PNG File image-2020-03-03-08-34-17-954.png     File mongo-rs-1.log     File mongo.log    
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
Version: 19.03.4
API version: 1.40
Go version: go1.12.10
Git commit: 9013bf583a
Built: Fri Oct 18 15:53:51 2019
OS/Arch: linux/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 19.03.4
API version: 1.40 (minimum version 1.12)
Go version: go1.12.10
Git commit: 9013bf583a
Built: Fri Oct 18 15:52:23 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc8+dev
GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version: 0.18.0
GitCommit: fec3683

 

Mongo Image Details:

MongoDB shell version v4.2.2
connecting to: mongodb://127.0.0.1:27017/version?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("70eb55b4-373a-4939-8b4a-57b0a1e1fbda") }
MongoDB server version: 4.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.

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