[Tarantool-patches] [PATCH 1/2] replication: introduce ballot.can_be_leader

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu Jul 22 00:43:20 MSK 2021


>>      A  B  C  D  E
>>     {-, -, 4, 3, 3}
>>            F  F  V
>>
>> Now the node E can vote for C and D because its index is LE.
>> And since C's index is bigger than others it will be elected
>> next as far as I understand, no?
> 
> You're right, assuming the voter never casts a vote for a
> candidate with a shorter log the safety is not violated. I wasn't
> sure it's the case, and presumed that the voter may have no log of
> its own. But still there are issues with liveness. Raft PHD has
> learners, so why not use them instead.

Because I didn't think of that before. It seems we need learners.
Otherwise when a cluster is started with a single node, an attempt
to add a second node will make the first one not able to commit
anything, because it won't be able to gather a quorum for its sync
transactions, nor won't even be elected as a leader again until
the second node finishes recovery.

We probably could make all new nodes learners automatically at least
until they finish both join stages. Or make it manual, don't know
yet. Anyway, the main problem I see right away is that the learner
role means we can't just get `_cluster:count() / 2 + 1` as a quorum
value. Because not all registered nodes participate in quorum.

Later I will create a ticket for that learner feature.


More information about the Tarantool-patches mailing list