-
Notifications
You must be signed in to change notification settings - Fork 552
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
Raft vote process unification #16847
Raft vote process unification #16847
Conversation
/dt |
3ecbdf1
to
1fd3716
Compare
/dt |
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/45630#018e0aa5-59f3-4c60-b41a-edf52defa39a ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/45630#018e0aa5-59f0-4de2-aa21-628a9207ce97 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/45630#018e0ab6-ddf9-48a0-85b1-307ac8d414a4 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/45630#018e0ab6-ddfc-494a-b391-075838e9c7d4 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/45630#018e0ab6-ddfe-493b-a9b0-f775e3378d65 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/45736#018e13cb-1e3a-4139-a7a2-c3bc7f4974b0 |
1fd3716
to
18502f8
Compare
/dt |
new failures in https://buildkite.com/redpanda/redpanda/builds/45694#018e0ec5-7114-4153-b564-00203f4f0997:
|
18502f8
to
f18e4a7
Compare
Signed-off-by: Michal Maslanka <michal@redpanda.com>
`raft::prevote_stm` is basically a copy of `raft::vote_stm` without few parts. Changed the `raft::vote_stm` to handle both the pre-vote and actual vote phases. The changes are rather cosmetic and only skip some parts when working in pre-voting mode. Signed-off-by: Michal Maslanka <michal@redpanda.com>
Since pre-voting is now handled by `vote_stm` the prevote stm can be completely removed. Signed-off-by: Michal Maslanka <michal@redpanda.com>
Refactored stream output operators of raft types to use `fmt` library. Previously the string representation of Raft types was inconsistent (missing white spaces, commas etc). Signed-off-by: Michal Maslanka <michal@redpanda.com>
Previously `prevote_stm` was incorrectly calculating timeout value leading to usage of very large timeout. Adjusted the default timeout of vote_stm to make leader election less prone to network delays and system load fluctuations. Signed-off-by: Michal Maslanka <michal@redpanda.com>
f18e4a7
to
8ddf93c
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, one question.
@@ -49,9 +50,13 @@ vote_stm::~vote_stm() { | |||
"Must call vote_stm::wait()"); | |||
} | |||
ss::future<result<vote_reply>> vote_stm::do_dispatch_one(vnode n) { | |||
auto tout = _ptr->_jit.base_duration(); | |||
auto tout = _ptr->_jit.base_duration() * 3; |
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.
didn't understand the "* 3" part, whats special about 3?
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.
i just use a timeout that is 3 time greater than the election timeout, not to introduce an additional parameter.
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.
@mmaslankaprv wondeirng if jit
should have a method base_duration_with_multiplier(3)
or smth like that.
this is neat. |
raft::prevote_stm
was basically a copy ofraft::vote_stm
without fewparts. Removed the
prevote_stm
and madevote_stm
handling bothcases.
Backports Required
Release Notes