How does failover work between S- S in a P- S - S set up

Mongo doc says the voting member should be in odd numbers like - 3,5,7

Assuming my env is 3 -->ie primary -secondary-secondary

Now my primary is down leaving only 2 secondary

Let say that both of my secondary have priority =50 and same amount of data replicated from primary …, in this case how election will be determined?

Wont there be a tussle for primary position BW the 2 secondary ? as both are equally fit to become primary

Kindly advise thanks

Experts , please advise

Hi, welcome to MongoDB Community.

The MongoDB election process works based on the heartbeat process, which is basically a ping between nodes so that they can validate communication between themselves. If one of the nodes does not receive a response from another node, this node will request the election and the others will vote for it. So, in addition to the obvious priority process and lag in the replica, what can influence it is the network latency itself.

In other databases, they use the raft process to help with the elections, it is similar to the one used by MongoDB, but in MongoDB there are a few differences that make the election faster overall.

Hope this helps.