How a Member Server is Elected Leader
All member servers within a server group periodically communicate with each other by sending a ballot message to other members in the group. This process is used to select a leader for the group. By default, this election cycle occurs every 10 seconds. Ballots can be sent using either a Rallypoint or IGMP multicast, and both methods can be used simultaneously for increased reliability and resilience.
It is important to note that leader elections in the context of Instant Connect differ from typical democratic elections in several key ways:
1. Self-Voting: Member servers do not vote for other member servers; they only vote for themselves.
2. Idempotency: Ballots are idempotent, meaning receiving more than one ballot from a candidate does not affect the election outcome.
3. Vote Count: The winner of the election is not solely determined by the number of votes received.
4. Decentralized Decision-Making: Each member server independently determines the election winner. There is no centralized registrar counting the ballots. Instead, each server follows a specific algorithm, outlined in this document, to decide the winner.
5. Voter ID: When a member server is created, it is assigned a unique ID used for elections. This candidate ID is randomly generated as a UUID v4 and remains unchanged once assigned.