[Tarantool-patches] [PATCH 1/7] replication: always send raft state to subscribers

Serge Petrenko sergepetrenko at tarantool.org
Fri Jun 11 11:43:12 MSK 2021



10.06.2021 19:47, Cyrill Gorcunov пишет:
> On Thu, Jun 10, 2021 at 04:32:51PM +0300, Serge Petrenko wrote:
>> -	if (raft_is_enabled(box_raft())) {
>> +	if (replica_version_id >= version_id(2, 6, 0) && !anon) {
>>   		/*
>>   		 * Send out the current raft state of the instance. Don't do
>> -		 * that if Raft is disabled. It can be that a part of the
>> -		 * cluster still contains old versions, which can't handle Raft
>> -		 * messages. So when it is disabled, its network footprint
>> -		 * should be 0.
>> +		 * that if the remote instance is old. It can be that a part of
>> +		 * the cluster still contains old versions, which can't handle
>> +		 * Raft messages. Raft's network footprint should be 0 as seen
>> +		 * by such instances.
>>   		 */
> Serge, why can't we send raft state for anon replicas as well? As far
> as I understand anon replicas do receive raft updates from WAL notifications,
> right? So this is somehow inconsistent that WAL's based raft updates are
> reaching anon replicas while initial state from subscribe state is not,
> or I miss something?

No, anon replicas don't receive Raft notifications at all.
See relay_send_is_raft_enabled() calls.

Also raft state is persisted as a local row, and it's not replicated
directly via WAL.
All raft state updates are pushed to peers via relay_push_raft().

So, I wanted to stay consistent here, i.e. not send raft state to 
anonymous replicas.

Besides, anonymous replicas can't enable elections at all, so there's no 
point in
sending the updates to them.


-- 
Serge Petrenko



More information about the Tarantool-patches mailing list