-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
box: prevent demoted leader from being a candidate in the next elections #10003
box: prevent demoted leader from being a candidate in the next elections #10003
Conversation
1daa7b9
to
d393e66
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the patch. Left some comments
test/replication-luatest/gh_9855_box_ctl_demote_guarantee_demoting_test.lua
Outdated
Show resolved
Hide resolved
d393e66
to
7043a97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the patch. LGTM! No major objections
08567b4
to
edc283a
Compare
edc283a
to
c05f6dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch!
Please find my comments below.
test/replication-luatest/gh_9855_box_ctl_demote_guarantee_demoting_test.lua
Show resolved
Hide resolved
Suggested by Nikita Zheleztsov in the scope of tarantool#9855. Needed for tarantool#9855 NO_CHANGELOG=<refactoring> NO_DOC=<refactoring> NO_TEST=<refactoring> Co-authored-by: Nikita Zheleztsov <[email protected]>
c05f6dc
to
31d4b92
Compare
8e7c77a
to
b3284e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes!
546b8e3
to
388de0a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@CuriousGeorgiy, some tests still fail in CI: |
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 tarantool#9855 NO_DOC=<bugfix> Co-authored-by: Serge Petrenko <[email protected]>
388de0a
to
374f8c9
Compare
@sergepetrenko fixed: added a synchronization point to wait for the restarted server to synchronize with the leader. |
This patch prevents the demoted leader from being a candidate in the next elections.
Closes #9855