Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH 0/2] Bootstrap voter
@ 2021-07-15 23:49 Vladislav Shpilevoy via Tarantool-patches
  2021-07-15 23:49 ` [Tarantool-patches] [PATCH 1/2] replication: introduce ballot.can_be_leader Vladislav Shpilevoy via Tarantool-patches
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Vladislav Shpilevoy via Tarantool-patches @ 2021-07-15 23:49 UTC (permalink / raw)
  To: tarantool-patches, gorcunov, sergepetrenko

In the patch I don't like this start/stop_candidate() calls. They look bulky.
I wanted to replace them with a function like raft_try_candidate() which would
make the instance a candidate for one current term.

Also I don't like box_raft_wait_leader_found() in bootstrap. Even though it
should always succeed in a couple of WAL writes.

The only problem with having a one-term try_candidate() is the split vote in
box_promote(). There between start_candidate() and stop_candidate() several
terms can pass if they end without a leader elected. I want to keep this
working. But I couldn't find a simple way to make raft_try_candidate() work like
that.

Nor I could find a nice way to retry the candidate attempts in box_promote().
In the end, if box_raft_wait_leader_found() fails, you need to restore the
candidate state. And this leads to having some kind of start/stop_candidate
anyway.

If you have ideas how to make it look better, I am looking forward to hearing
it.

Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-6018-boot-voter
Issue: https://github.com/tarantool/tarantool/issues/6018

Vladislav Shpilevoy (2):
  replication: introduce ballot.can_be_leader
  election: during bootstrap prefer candidates

 .../unreleased/gh-6018-election-boot-voter.md |   4 +
 src/box/box.cc                                |  28 ++++-
 src/box/iproto_constants.h                    |   1 +
 src/box/replication.cc                        |  11 +-
 src/box/xrow.c                                |  14 ++-
 src/box/xrow.h                                |   2 +
 .../gh-6018-election-boot-voter.result        | 116 ++++++++++++++++++
 .../gh-6018-election-boot-voter.test.lua      |  59 +++++++++
 test/replication/gh-6018-master.lua           |  17 +++
 test/replication/gh-6018-replica.lua          |  15 +++
 test/replication/suite.cfg                    |   1 +
 11 files changed, 263 insertions(+), 5 deletions(-)
 create mode 100644 changelogs/unreleased/gh-6018-election-boot-voter.md
 create mode 100644 test/replication/gh-6018-election-boot-voter.result
 create mode 100644 test/replication/gh-6018-election-boot-voter.test.lua
 create mode 100644 test/replication/gh-6018-master.lua
 create mode 100644 test/replication/gh-6018-replica.lua

-- 
2.24.3 (Apple Git-128)


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2021-07-21 21:43 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 23:49 [Tarantool-patches] [PATCH 0/2] Bootstrap voter Vladislav Shpilevoy via Tarantool-patches
2021-07-15 23:49 ` [Tarantool-patches] [PATCH 1/2] replication: introduce ballot.can_be_leader Vladislav Shpilevoy via Tarantool-patches
2021-07-16 10:59   ` Serge Petrenko via Tarantool-patches
2021-07-18 17:00     ` Vladislav Shpilevoy via Tarantool-patches
2021-07-19  9:11       ` Sergey Petrenko via Tarantool-patches
2021-07-16 14:29   ` Konstantin Osipov via Tarantool-patches
2021-07-18 17:00     ` Vladislav Shpilevoy via Tarantool-patches
2021-07-19  9:12       ` Konstantin Osipov via Tarantool-patches
2021-07-19 22:06         ` Vladislav Shpilevoy via Tarantool-patches
2021-07-20  8:49           ` Konstantin Osipov via Tarantool-patches
2021-07-20 20:02             ` Vladislav Shpilevoy via Tarantool-patches
2021-07-20 20:18               ` Konstantin Osipov via Tarantool-patches
2021-07-20 21:16         ` Cyrill Gorcunov via Tarantool-patches
2021-07-20 23:20           ` Konstantin Osipov via Tarantool-patches
2021-07-21 18:51             ` Cyrill Gorcunov via Tarantool-patches
2021-07-21 21:43             ` Vladislav Shpilevoy via Tarantool-patches
2021-07-15 23:49 ` [Tarantool-patches] [PATCH 2/2] election: during bootstrap prefer candidates Vladislav Shpilevoy via Tarantool-patches
2021-07-16 11:30   ` Serge Petrenko via Tarantool-patches
2021-07-18 17:00     ` Vladislav Shpilevoy via Tarantool-patches
2021-07-16 14:27 ` [Tarantool-patches] [PATCH 0/2] Bootstrap voter Konstantin Osipov via Tarantool-patches
2021-07-18 17:00   ` Vladislav Shpilevoy via Tarantool-patches
2021-07-19  9:13     ` Konstantin Osipov via Tarantool-patches
2021-07-19 22:04       ` Vladislav Shpilevoy via Tarantool-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox