election: fix box.ctl.demote() nop in off-mode
box.ctl.demote() used not to do anything with election_mode='off' if the synchro queue didn't belong to the caller in the same term as the election state. The reason could be that if the synchro queue term is "outdated", there is no guarantee that some other instance doesn't own it in the latest term right now. The "problem" is that this could be workarounded easily by just calling promote + demote together. There isn't much sense in fixing it for the off-mode because the only reasons off-mode exists are 1) for people who don't use synchro at all, 2) who did use it and want to stop. Hence they need demote just to disown the queue. The patch "legalizes" the mentioned workaround by allowing to perform demote in off-mode even if the synchro queue term is old. Closes #6860 NO_DOC=bugfix (cherry picked from commit 1afe2274)
Showing
- changelogs/unreleased/gh-6860-demote-in-off-mode.md 4 additions, 0 deletionschangelogs/unreleased/gh-6860-demote-in-off-mode.md
- src/box/box.cc 27 additions, 7 deletionssrc/box/box.cc
- test/replication-luatest/gh_6842_qsync_applier_order_test.lua 4 additions, 1 deletion.../replication-luatest/gh_6842_qsync_applier_order_test.lua
- test/replication-luatest/gh_6860_election_off_demote_test.lua 196 additions, 0 deletions.../replication-luatest/gh_6860_election_off_demote_test.lua
Loading
Please register or sign in to comment