Skip to content
Snippets Groups Projects
Commit 32ae0254 authored by Serge Petrenko's avatar Serge Petrenko Committed by Vladislav Shpilevoy
Browse files

raft: fix 'manual' nodes bumping the term excessively

A node configured in 'manual' mode and promoted by `box.ctl.promote()`
stays in is_candidate state for the whole term, even though it is not
is_cfg_candidate.

If such a node is the first one to notice leader death or to hit the
election timeout, it bumps the term excessively, then immediately
becomes a mere follower, because its is_candidate is reset with
is_cfg_candidate.

This extra term bump (one term after the node was actually promoted) is
unnecessary and might lead to strange errors:

tarantool> box.ctl.promote()
---
- error: 'The term is outdated: old - 3, new - 4'
...

Fix this by checking if a node is configured as a candidate before
trying to start new elections.

Closes #8168

NO_DOC=bugfix

(cherry picked from commit 5765fdc4)
parent 73aaa884
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment