Mongodb Intialsync failed at specific db collection

also noticed that during this slow query on that particular collection, the DB(which is doing the Initialsync) received some batches and starts saving a snapshot on the disk at this point it takes some time (more than 10 minutes) and keeps the connection with the sync source host ideal for 10 minutes which hits the limit of “cursorTimeoutMillis” : NumberLong(600000)` which caused the connection ended.

I’m not sure if this makes any sene to you but I believe if can increase this value cursorTimeoutMillis or making the saving snapshot process take less time that will fix the initialsync issue .
I will be waiting for your kind feedback about the above, thank you

For anyone who might face this issue with initialsync, I found the issue with TCP connections getting dropped after sometime with reason “expired connection pool”, I tried to adjust kernel TCP keeplive values but mongo overrides it with 5 minutes max, anyway I couldn’t fix this.

The only solution to make it work is to pre-seed the data using rsync to the other nodes, then the replication will work :white_check_mark:

1 Like