-
Notifications
You must be signed in to change notification settings - Fork 75
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
[Feature]: Improve timeout mechanism in Curp #162
Labels
enhancement
New feature or request
Comments
markcty
added a commit
to markcty/Xline
that referenced
this issue
Feb 3, 2023
markcty
added a commit
to markcty/Xline
that referenced
this issue
Feb 6, 2023
markcty
added a commit
to markcty/Xline
that referenced
this issue
Feb 6, 2023
markcty
added a commit
to markcty/Xline
that referenced
this issue
Feb 6, 2023
markcty
added a commit
to markcty/Xline
that referenced
this issue
Feb 10, 2023
markcty
added a commit
to markcty/Xline
that referenced
this issue
Feb 10, 2023
Phoenix500526
pushed a commit
that referenced
this issue
Feb 13, 2023
markcty
added a commit
to markcty/Xline
that referenced
this issue
Feb 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description about the issue
Currently, our code uses a real system time timeout mechanism, which is straight forward and easy to understand. However, obtaining system time is not efficient. We need to update
last_rpc_time
every time we receive a newappend_entries
, which could lead to performance issue when the server is busy.Etcd offers a more clever timeout detection mechanism based on
tick
. A task is spawned to periodically performtick
operation. Every tick is 1 heartbeat interval. Atick
will increaseelection_timeout
andheartbeat_timeout
by 1. A broadcast of heartbeats(for leader) or a new round of election(for follower) will be performed when timeout.I believe adopting this method will improve curp’s performance as well as readability(since all periodically executed operations will be in one place).
Approach
last_rpc_time
. Addheartbeat_timeout
andelection_timeout
tick count.bg_election
andbg_heartbeat
.Code of Conduct
The text was updated successfully, but these errors were encountered: