Major - P3
I have the following situation:
- I have a GridFS bucket with 810,959 files (.files count) stored in 2,499,160 chunks (.chunks count)
- I want to iterate over all entries in .chunks and print (just for sake of simplicity) the _id of each entry
- for this I use the following command
- what I expect is to have the screen filled with 2m+ IDs (I know, useless, but again, for sake of simplicity)
- what happens is that after exactly 101 IDs, the script freezes. Waited for hours (I am a curious guy), but it never recovered
- I read the same issue https://jira.mongodb.org/browse/SERVER-35106 (unfortunately closed with CNR) and tried setting the batchSize to 100
- this time it does not freeze forever, but between batches there is significant delays of up to minutes (which makes the solution unusable since there are 2m+ records and there are only 1,440 minutes in a day)
- I also found out that the problem comes up occasionally, but never a working solution is provided (seems hard to reproduce), for eg. see:
During the time the query executes, I have the following output from currentOp:
Server is MongoDB 4.0.18 running on Ubuntu 18.04 setup in replica set mode.
I have tried to run the command on different servers from replica set
If I can help you with other information, please let me know.
Any help is greatly appreciated.