raft: fix box.ctl.promote() hanging when cannot gather a quorum
Fixing a bug with nodes in 'manual' election mode bumping the term excessively revealed a hang in election_pre_vote test. Turns out the test passed thanks to the previous buggy behaviour. The following behaviour is expected: when a node is configured in manual election mode, calling box.ctl.promote() on it should make it bump term once, try to gather votes and fail on timeout. Once the extra term bump on timeout was removed in commit 5765fdc4 ("raft: fix 'manual' nodes bumping the term excessively"), box.ctl.promote() without a quorum started hanging. Let's return the correct behaviour: 'manual' nodes should transition back to follower if an election timeout passes after the promotion without any term outcome. Enable the test_promote_no_quorum testcase of election_pre_vote test back, since it's fixed now. Follow-up #8168 Closes #8217 NO_DOC=bugfix NO_CHANGELOG=changes not released behaviour (cherry picked from commit 352fe0c7)
Showing
- src/box/raft.c 6 additions, 3 deletionssrc/box/raft.c
- src/lib/raft/raft.c 2 additions, 0 deletionssrc/lib/raft/raft.c
- test/replication-luatest/election_pre_vote_test.lua 0 additions, 1 deletiontest/replication-luatest/election_pre_vote_test.lua
- test/replication-luatest/gh_8168_extra_term_bump_test.lua 16 additions, 4 deletionstest/replication-luatest/gh_8168_extra_term_bump_test.lua
- test/unit/raft.c 1 addition, 1 deletiontest/unit/raft.c
- test/unit/raft.result 1 addition, 1 deletiontest/unit/raft.result
Loading
Please register or sign in to comment