[Tarantool-patches] [PATCH v4 07/16] replication: send current Raft term in join response
Sergey Petrenko
sergepetrenko at tarantool.org
Thu Jul 29 23:46:40 MSK 2021
27.07.2021 02:43, Vladislav Shpilevoy пишет:
> On 23.07.2021 09:44, Sergey Petrenko wrote:
>> 22.07.2021 01:24, Vladislav Shpilevoy пишет:
>>> Thanks for the patch!
>>>
>>>> diff --git a/src/box/relay.cc b/src/box/relay.cc
>>>> index 4b102a777..70f1a045b 100644
>>>> --- a/src/box/relay.cc
>>>> +++ b/src/box/relay.cc
>>>> @@ -451,6 +453,10 @@ relay_initial_join(int fd, uint64_t sync, struct vclock *vclock,
>>>> row.sync = sync;
>>>> coio_write_xrow(&relay->io, &row);
>>>> + xrow_encode_raft(&row, &fiber()->gc, &raft_req);
>>>> + row.sync = sync;
>>>> + coio_write_xrow(&relay->io, &row);
>>> You might need to send it before the limbo checkpoint. Otherwise
>>> the problem is exactly the same - the master could send the limbo
>>> state, the replica applied it, then the master dies before sending the
>>> raft state, then the replica has limbo's term > raft term.
>> Yep, thanks for noticing! Fixed.
> Hm, but is it really possible? If the initial join is not finished
> (the master didn't send data) and only the limbo is delivered, then
> the remote instance is going to fail its bootstrap anyway and won't
> use the partially received state.
That's true. Anyway, let's send raft state and limbo state in correct order,
just to keep things consistent. Otherwise we'll have a point in time when
limbo term is bigger than raft term. Let's better get rid of such cases
completely.
More information about the Tarantool-patches
mailing list