These are chat archives for atomix/atomix

14th
Oct 2017
Jordan Halterman
@kuujo
Oct 14 2017 01:49
But I suppose it's worth a thought exercise to see if it's feasible to prioritize leaders inside the Raft protocol...
I think the problem is that Raft nodes nominate themselves and requests votes from other nodes, and once a node has voted for one candidate it can't vote for another one. Prioritizing nodes in an election may require nodes nominating other nodes in priority order.
Jordan Halterman
@kuujo
Oct 14 2017 01:56

So thinking out loud, if I were to take a stab at implementing prioritized elections inside Raft, I'd look at the election protocol... Nodes' election timers timeout, they transition state and vote for themselves and then request votes from other nodes. Votes are granted if the candidate's log is as up to date as the voter's log.

I imagine one way to prioritize an election could be to add additional conditions to voters to prevent them from voting for nodes that are lower priority than themselves if their log is as up-to-date as the candidate's. Raft guarantees a majority of the nodes can win in an election. Rejecting vote requests by priority should cause the cluster to tend towards the highest priority leader.

Of course, this election protocol wouldn't mean the highest priority node is elected if available, because we have to ensure the safety properties of Raft before prioritizing leaders. Only the nodes with all the commits can be elected. It would just tend towards the highest priority nodes.