Not sure how to ask this. I have a process that is importing thousands of records to the database using a bulkwrite. I process 1000 documents and then write that and then get the next thousand and write that etc. This works perfectly in a 1 database scenario and i'm working on setting up replication. When replicating, I'm getting a write concern error 64 "waiting for replication timed out" frequently. I do have journaling turned on and have the rs.config set with w:majority. My understanding is that means to be sure its written to at least the journal before the response is returned. I'm not sure how best to handle the write concern error though. Do i just capture it and continue on? or do I need to reprocess some records? Both primary and secondary have the same document count when executing the count() request on the collection. Any guidance on what best practices are for this would be helpful. thanks.

1 Answer 1


"waiting for replication timed out" is not a Error , this is a warning msg that your document has not been written to majority of your replica server. but this going to be replicate.

what you can do is along with W:majority configure one more parameter wtimeout:5000 , with this you can overcome of this warning messages.

""Do i just capture it and continue on? or do I need to reprocess some records?"" You can set w:1 for specific process for example a bulk write.

  • I've set wtimeout:5000 and tried with w:1 Both still produce the "waiting for replication" message. it sounds like i can just capture it and continue on though and shouldn't have any issues. Is that a correct assessment?
    – Thomasc
    Commented Mar 14, 2018 at 12:06
  • check if you are configuring w:1 in correct way , because it should not produce error message with W:1. and second thing you can set wtimeout:10000 and check. Commented Mar 16, 2018 at 6:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.