[Tarantool-patches] [PATCH 1/4] raft: fix crash on election_timeout reconfig
Serge Petrenko
sergepetrenko at tarantool.org
Tue Jan 18 16:12:08 MSK 2022
15.01.2022 03:48, Vladislav Shpilevoy пишет:
> It used to crash if done during election on a node voted for
> anybody, it is a candidate, it doesn't know a leader yet, but has
> a WAL write in progress.
>
> Thus it could only happen if the term was bumped by a message from
> a non-leader node and wasn't flushed to the disk yet.
>
> The patch makes the reconfig check if there is a WAL write in
> progress. Then don't do anything.
>
> Could also check for volatile vote instead of persistent, but it
> would create the same problem for the case when started writing
> vote for self and didn't finish yet. Reconfig would crash.
> ---
> .../unreleased/election-timeout-cfg-crash.md | 5 ++
> src/lib/raft/raft.c | 3 +-
> test/unit/raft.c | 75 ++++++++++++++++++-
> test/unit/raft.result | 16 +++-
> 4 files changed, 96 insertions(+), 3 deletions(-)
> create mode 100644 changelogs/unreleased/election-timeout-cfg-crash.md
>
>
Good catch! LGTM.
--
Serge Petrenko
More information about the Tarantool-patches
mailing list