[SERVER-29742] mongodump only creates a partial dump Created: 20/Jun/17  Updated: 29/Jul/17  Resolved: 28/Jun/17

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

Type: Bug Priority: Major - P3
Reporter: Christian Indra Assignee: Mark Agarunov
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File mongos-stage-mongo15.txt     Text File shard1_primary-stage-mongo15.txt     Text File shard2_primary-stage-mongo17.txt     Text File shard3_primary-stage-mongo16.txt    
Issue Links:
Duplicate
duplicates SERVER-3645 Sharded collection counts (on primary... Closed
Operating System: ALL
Participants:

 Description   

I tried to execute mongodump with the -q parameter.

mongodump --host localhost --port 27017 -c dvc_id_reports -q {time:{$lt:ISODate("2016-06-20T00:00:00Z")}} -d testdb -o ./dump/

But it dumps only 241512 documents. (according to ouput of mongodump)
If i execute the same query with a count-command it returns 828413 documents.

db.getCollection('dvc_id_reports').count({time:{$lt:ISODate("2016-06-20T00:00:00Z")}})
// or
db.getCollection('dvc_id_reports').find({time:{$lt:ISODate("2016-06-20T00:00:00Z")}}).count()

But if i use itcount() also return the wrong number of documents (241512):

db.getCollection('dvc_id_reports').find({time:{$lt:ISODate("2016-06-20T00:00:00Z")}}).itcount()



 Comments   
Comment by Christian Indra [ 29/Jun/17 ]

I'm nor sure if it's the same issue. Because also the mongodump is affected. Not only the count method.

Comment by Mark Agarunov [ 28/Jun/17 ]

Hello chi@tractive.com,

Thank you for providing this information. Looking over this, it seems that the behavior you're seeing is caused by the same issue as SERVER-3645 where count returns an incorrect value on sharded setups. I've closed this as a duplicate, please watch SERVER-3645 for updates on the progress of this issue.

Thanks,
Mark

Comment by Christian Indra [ 23/Jun/17 ]

Now i tried to check the distribution of the data.
I connected to the primary mongod node of every shard and executed the count query. And all data is really just in one mongod:
stage-mongo15: 0
stage-mongo16: 0
stage-mongo17: 830504

And here on the mongod-host it doesn't matter which command i use:

  • find(...).count() return 830504
  • find(...).itcount() return 830504

So it's just not working when i use the mongos for the same query.

Note: The numbers a slightly different, because i used a different day for the query.

Comment by Christian Indra [ 23/Jun/17 ]

I have 3 shards. I have attached the logs of the primary of each shard and the mongos that where used by mongodump.

Comment by Mark Agarunov [ 22/Jun/17 ]

Hello chi@tractive.com,

Thank you for the report. So that we can further investigate the behavior of mongodump described, could you please provide the complete log files from mongod from the affected nodes when this issue occurred. This may give some more insight into why there is a discrepancy between the number of documents returned.

Thanks,
Mark

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