rabbitmq / ra

A Raft implementation for Erlang and Elixir that strives to be efficient and make it easier to use multiple Raft clusters in a single system.
Other
813 stars 96 forks source link

Allow lower versioned members to vote for higher versioned members if the effective machine version matches #256

Closed kjnilsson closed 1 year ago

kjnilsson commented 2 years ago

Currently a member with a lower machine version will never vote for a member with a higher machine version. This is to avoid a higher versioned member being elected before there is a quorum of higher versioned members. This is somewhat too restrictive in the edge case where there already is a quorum of higher versioned members but the quorum is lost.

Say if node A (leader) and B run version 2 and node C run version 1 and A is terminated currently neither B nor C can be elected leader. To allow C to vote for B we could allow this if the effective machine version known by C matches the machine version of B.

To do so we can add a clause for this in the ra_server:process_pre_vote function to allow this specific case.