3 members replica got stuck in STARTUP2 phase - MongoDB 4.2.3

We have replica set with 3 members (host1, host2 - primary/secondary members + host3 - arbiter) on MongoDB 4.2.3. All server can communicate with each other. Due to unknown problem currently the replica set in not able to start a replica set. There is also plenty of free space on disk. It got stuck in init sync phase. Host1 is trying to sync data from host2 and host2 tries to do the same with host1. The results is: “E INITSYNC [replication-0] Initial sync attempt failed – attempts left: 0 cause: InitialSyncOplogSourceMissing: No valid sync source found in current replica set to do an initial sync.” on both servers. After a while a mongod process is stopped on both servers. I have analyzed documentation - initially I thouoght that initial sync will do the work but none of this servers is elected as primary. The question is how to that restore replica set to be operational ?

@elG Are you trying to setup a new replica set or do you already have data on them?
If it’s a new configuration, I would try to remove one host of the replica, wait for the other one to become primary and then add it again. However, it seems like your oplog might be rolling before the sync completes. If the oplog is too small then you will not be able to complete the initial sync and new member will stay in a STARTUP2 state.
I would recommend checking the oplog window and if this is not the problem, trying to force a reconfig on the replica set.

2 Likes