Skip to content
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

Refactor: Send heartbeat with dedicated workers #1224

Closed
wants to merge 3 commits into from

Conversation

drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Aug 4, 2024

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 to Progress

Refactor: Move sleep_until() and timeout_at() out of AsyncRuntime trait

The sleep_until() and timeout_at() functions can be automatically
derived from sleep() and timeout(). This change removes the need for
applications to implement these functions for the AsyncRuntime trait.
They are now provided by TypeConfigExt.


This change is Reviewable

…e` trait

The `sleep_until()` and `timeout_at()` functions can be automatically
derived from `sleep()` and `timeout()`. This change removes the need for
applications to implement these functions for the `AsyncRuntime` trait.
They are now provided by `TypeConfigExt`.
`HigherVote` can be sent directly to Notification channel.
replication::Response does not need `HigherVote` variant any more.
And `Response` is renamed to `Progress`
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.
@drmingdrmer
Copy link
Member Author

@ariesdevil

@drmingdrmer drmingdrmer closed this Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant