I am confused as to how MongoDB voting happens internally. The MongoDB docs don't seem to give details--they merely discuss voting at a high level. This post (Voting in MongoDB) explains the results but not the internals.
From what I have researched, two options seem possible:
I know these are similar, but I need to be able to explain how voting works for a presentation. Which option is correct? A combination?
Important followup question: What happens in a tie, or if no member receives a majority?
The underpinning concept of replica set design is based on the fact that there is a majority of the replica set available when there is an election i.e odd number of members (see mongodb replica set architecture docs). In reality, this is actually a majority of the number of total votes in the replica set, which doesn't necessarily mean that there is one vote per member pre v3.0 (mongod).
Here's the way an ideal election steps out:
Sorry for lack of links, I can't post more than one
FYI, I believe v3.2 will be implementing some (if not all) of the RAFT algorithm for consensus
good explanation of elections from k chodorow: http://www.kchodorow.com/blog/2012/01/04/replica-set-internals-bootcamp-part-i-elections/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With