Refactor: Send heartbeat with dedicated workers #1224
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog
Refactor: Send heartbeat with dedicated workers
Heavy AppendEntries traffic can block heartbeat messages. For example,
future AppendEntries in stream RPC may not receive a response indicating
a follower is alive. In such cases, the leader might time out to extend
its lease, and be considered partitioned from the cluster.
This commit moves heartbeat broadcasting to separate tasks that won't be
blocked by AppendEntries. This ensures the leader can always be
acknowledged with the liveness of followers.
Refactor: simplify HigherVote notification
HigherVote
can be sent directly to Notification channel.replication::Response does not need
HigherVote
variant any more.And
Response
is renamed toProgress
Refactor: Move
sleep_until()
andtimeout_at()
out ofAsyncRuntime
traitThe
sleep_until()
andtimeout_at()
functions can be automaticallyderived from
sleep()
andtimeout()
. This change removes the need forapplications to implement these functions for the
AsyncRuntime
trait.They are now provided by
TypeConfigExt
.This change is