Setting priority for replica set member

Hi,

We have replica set cluster with 3 members(P-S-S) and priority set to 1 for all the 3 members. Could someone pls help me to understand 1) Is it ok to set priority 1 for all the 3 members 2) What will happen if primary goes down 3) What will happen when down node back.

Basically I have to understand is it ok to set priority 1 for primary and secondary members or we have to set lesser value for secondary compare to primary.

Thanks,
Vikas

All nodes having priority 1 is considered standard. Each node should be of equal capability and would be able to handle the production load. If you need the primary to shift back to a particular node/datacentre adjusting priority is the mechanism you would use.

If the primary goes down or is partitioned from the other nodes an election for a new primary will occur and the winner will become the new primary.

When the failed node comes back it will reconnect to the replica set, roll back any writes that did not replicate to the majority, catch up to the primary and become a secondary.

2 Likes

Thanks Chris for the detailed info…

I have one more concern w.r.to replica set, believe it is altogether different. Could you pls help to understand
If I set “writeMajorityCount” : 2 for 3 member replica set(P-S-S), then write acknowledgement will get only when write happens on primary and in one of the secondary. In this case how secondary will be choose, Is it based on priority set or any other formula?

Thanks,
Vikas

Hi @Vikas_Reddy

Whichever secondary acknowledges the write first fulfills the write concern, various conditions could affect which one(s) that is .

2 Likes