box: prevent demoted leader from being a candidate in the next elections
Currently, the demoted leader sees that nobody has requested a vote in the newly persisted term (because it has just written it without voting, and nobody had time to see the new term yet), and hence votes for itself, becoming the most probable winner of the next elections. To prevent this from happening, let's forbid the demoted leader to be a candidate in the next elections using `box_raft_leader_step_off`. Closes #9855 NO_DOC=<bugfix> Co-authored-by:Serge Petrenko <sergepetrenko@tarantool.org> (cherry picked from commit 05d03a1c)
Showing
- changelogs/unreleased/gh-9855-box-ctl-demote-guarantee-demoting.md 5 additions, 0 deletions...s/unreleased/gh-9855-box-ctl-demote-guarantee-demoting.md
- src/box/box.cc 2 additions, 3 deletionssrc/box/box.cc
- src/box/raft.c 13 additions, 0 deletionssrc/box/raft.c
- src/box/raft.h 9 additions, 0 deletionssrc/box/raft.h
- test/replication-luatest/gh_6033_box_promote_demote_test.lua 5 additions, 0 deletionstest/replication-luatest/gh_6033_box_promote_demote_test.lua
- test/replication-luatest/gh_6860_election_off_demote_test.lua 13 additions, 0 deletions.../replication-luatest/gh_6860_election_off_demote_test.lua
- test/replication-luatest/gh_9855_box_ctl_demote_guarantee_demoting_test.lua 77 additions, 0 deletions...uatest/gh_9855_box_ctl_demote_guarantee_demoting_test.lua
Loading
Please register or sign in to comment