-
Notifications
You must be signed in to change notification settings - Fork 593
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
Fix stepping down on timeout #24590
base: dev
Are you sure you want to change the base?
Fix stepping down on timeout #24590
Conversation
717a5fa
to
c321e29
Compare
Retry command for Build#59862please wait until all jobs are finished before running the slash command
|
CI test resultstest results on build#59862test results on build#59902
test results on build#59984
|
c321e29
to
e203f89
Compare
Retry command for Build#59902please wait until all jobs are finished before running the slash command
|
e203f89
to
592fc64
Compare
Retry command for Build#59984please wait until all jobs are finished before running the slash command
|
@@ -489,6 +490,8 @@ ss::future<> raft_node_instance::stop() { | |||
vlog(_logger.debug, "stopping protocol"); | |||
co_await _buffered_protocol->stop(); | |||
co_await _protocol->stop(); | |||
// release f_log pointer before stopping raft |
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.
Any reason we do it before? It should not matter, as it's a shared pointer, so the underlying object will only die when _raft
is gone.
Same question for stopping log before deleting raft, but it's out of scope of this PR.
The `raft::reply_result::follower_busy` is indicating that the follower was unable to process the heartbeat fast enough to generate a response. Renaming the reply from `timeout` will make it less confusing for the reader and differentiate the error code from an RPC timeout. Signed-off-by: Michał Maślanka <[email protected]>
Signed-off-by: Michał Maślanka <[email protected]>
Wired raft RPC service handler into Raft fixture to make the tests more accurate and cover the service code with tests. Signed-off-by: Michał Maślanka <[email protected]>
Propagating timeout to the node sending RPC request is crucial for accurate testing of Raft implementation. Signed-off-by: Michał Maślanka <[email protected]>
Added a wrapper around the `storage::log` allowing us to inject storage layer failures in Raft fixture tests. Signed-off-by: Michał Maślanka <[email protected]>
When follower is busy it may fail fast processing full heartbeat requests sent by the leader. In this case a follower RPC handler sets the `follower_busy` result in heartbeat_reply. Leader should still treat a follower replica as online in this case. The replica hosting node must be online to reply with the `follower_busy` error. This way we prevent to eager leader step downs when follower replicas are slow. Signed-off-by: Michał Maślanka <[email protected]>
Signed-off-by: Michał Maślanka <[email protected]>
592fc64
to
67e7c6e
Compare
When follower is busy it may fail fast processing full heartbeat
requests sent by the leader. In this case a follower RPC handler sets
the
follower_busy
result in heartbeat_reply. Leader should still treata follower replica as online in this case. The replica hosting node must
be online to reply with the
follower_busy
error.This way we prevent to eager leader step downs when follower replicas
are slow.
Backports Required
Release Notes
Improvements