From: Serge Petrenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 4/4] election: activate raft split vote handling
Date: Tue, 18 Jan 2022 16:21:52 +0300 [thread overview]
Message-ID: <0477f8c4-344d-eed0-9f88-e3f6097342e5@tarantool.org> (raw)
In-Reply-To: <a86513c785f5084b20a4a709946cb2e30e9a8ef0.1642207647.git.v.shpilevoy@tarantool.org>
15.01.2022 03:48, Vladislav Shpilevoy пишет:
> Raft needs to know cluster size in order to detect and handle
> split vote. The patch uses registered server count as cluster
> size.
>
> It is not documented nor has a changelog file because this is an
> optimization. Can't be observed except in logs or with a watch.
>
> Closes #5285
Thanks for working on this!
Please, find one comment below.
> ---
> src/box/raft.c | 4 +-
> .../election_split_vote_test.lua | 92 +++++++++++++++++++
> 2 files changed, 95 insertions(+), 1 deletion(-)
> create mode 100644 test/replication-luatest/election_split_vote_test.lua
>
> diff --git a/src/box/raft.c b/src/box/raft.c
> index 1e360dc88..1908b71b6 100644
> --- a/src/box/raft.c
> +++ b/src/box/raft.c
> @@ -229,7 +229,9 @@ box_raft_update_election_quorum(void)
> * be lost.
> */
> int quorum = MIN(replication_synchro_quorum, max);
> - raft_cfg_election_quorum(box_raft(), quorum);
> + struct raft *raft = box_raft();
> + raft_cfg_election_quorum(raft, quorum);
> + raft_cfg_cluster_size(raft, replicaset.registered_count);
Better use `max` instead of `replicaset.registered_count` here.
I don't think something could go wrong with setting cluster size to zero
initially, but let's better avoid that.
> }
>
> void
...
--
Serge Petrenko
next prev parent reply other threads:[~2022-01-18 13:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-15 0:48 [Tarantool-patches] [PATCH 0/4] Split vote Vladislav Shpilevoy via Tarantool-patches
2022-01-15 0:48 ` [Tarantool-patches] [PATCH 1/4] raft: fix crash on election_timeout reconfig Vladislav Shpilevoy via Tarantool-patches
2022-01-18 13:12 ` Serge Petrenko via Tarantool-patches
2022-01-15 0:48 ` [Tarantool-patches] [PATCH 2/4] raft: track all votes, even not own Vladislav Shpilevoy via Tarantool-patches
2022-01-21 0:42 ` Vladislav Shpilevoy via Tarantool-patches
2022-01-15 0:48 ` [Tarantool-patches] [PATCH 3/4] raft: introduce split vote detection Vladislav Shpilevoy via Tarantool-patches
2022-01-18 13:20 ` Serge Petrenko via Tarantool-patches
2022-01-20 0:44 ` Vladislav Shpilevoy via Tarantool-patches
2022-01-20 10:21 ` Serge Petrenko via Tarantool-patches
2022-01-20 23:02 ` Vladislav Shpilevoy via Tarantool-patches
2022-01-15 0:48 ` [Tarantool-patches] [PATCH 4/4] election: activate raft split vote handling Vladislav Shpilevoy via Tarantool-patches
2022-01-18 13:21 ` Serge Petrenko via Tarantool-patches [this message]
2022-01-20 0:44 ` Vladislav Shpilevoy via Tarantool-patches
2022-01-16 14:10 ` [Tarantool-patches] [PATCH 0/4] Split vote Konstantin Osipov via Tarantool-patches
2022-01-17 22:57 ` Vladislav Shpilevoy via Tarantool-patches
2022-01-18 7:18 ` Konstantin Osipov via Tarantool-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0477f8c4-344d-eed0-9f88-e3f6097342e5@tarantool.org \
--to=tarantool-patches@dev.tarantool.org \
--cc=sergepetrenko@tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH 4/4] election: activate raft split vote handling' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox