In case of default replication which is chained replication in mongodb.
Say for example in a 3 NODE replica set :
NODE1 is primary and NODE2 is immediate next to NODE1 and catches up all oplog to become secondary and in sync with primary.
So my NODE3 in a chained replication gets all updates from NODE2 which is my secondary.
On what possible reasons my NODE3 will go out of sync from primary ?
like :
- When NODE3 is down for sometime by that time oplog grows on primary far away from this node. Is there a threshold of duration of time when a node can go out of sync?
- When NODE3 is far behind some size of oplog than primary. Can max oplog size be configurable so that replication cannot go out of sync ?
With chained replication enabled (by default) and if my NODE3 couldn't sync from either secondary(n2) or primary(n1) then for what reasons my NODE3 can go out of sync from n2 & n1.
How can 'out of sync' be avoided without disabling the chained replication(will add overhead on primary node)?