Does MongoDB Automatically Spin Up a New Secondary When the Original Primary Fails to Recover?

let’s say there are 3 nodes in my db(1 primary and 2 secondary), and primary goes down. then from the remaining 2 secondary, one of the nodes are made primary by election. we have 1 primary and 1 secondary at moment. would MongoDB spin up a new secondary if the earlier primary doesn’t recovers.

Hi @Gaurav_Yadav5

No it does not. If you are self hosting then the recovery or replacement of the failed member is on you.

If it is in MongoDB Atlas then open a ticket with MongoDB support.

For extra redundancy add two more member and go for a five member replica set. This allows up to two members to fail.

1 Like

Hi @chris
Thanks for the answer.
Also If I explicitly ask MongoDB support to spin up a new node. Then a full-resync would be done on the newly added right? And during this process, this node would be unavailable for reads if I have configured secondary read preference.

Hi @Gaurav_Yadav5

If you have a member down the support ticket would be to deal specifically with that, MongDB would recommend or take the best course of action.

If an initial sync is in progress a Secondary read will be serviced by the remaining secondaries.

Adding additional members in MongoDB Atlas, to go from 3 to 5 members for example, is your responsibility. Check configure-high-availability-and-workload-isolation for details.