Replication lag for more than 10 hours

Your insert operation is asking for WriteConcern: “majority”, and it has a timeout of 15 seconds, meaning if the system can’t write to at least 2 (two) nodes in the replica set in a time window of 15 seconds, the operation fails.

With the secondary ~10 hours behind the primary - or in some cases, as you mentioned, out of sync - any operation that requires w: “majority” with wtimeout: 15000 will fail.

That is one of the reasons I’m not a fan of PSA configs. You only have 2 data-bearing nodes to establish the majority, if anything happens with any of the data-bearing members, then your application is in trouble to work requests with w: “majority”.

(a) What is your MongoDB version?

(b) Can you share the output for rs.config() and rs.status()?

(b) Anything in the mongod.log or operating system log that could give you a hint about why the secondary can’t keep the replication going?

All the best,

– Rodrigo

2 Likes