-
Notifications
You must be signed in to change notification settings - Fork 227
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
Avoid sending requests to unhealthy leader #503
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sticnarf
force-pushed
the
consider-health
branch
3 times, most recently
from
May 18, 2022 12:36
0336712
to
b0d6592
Compare
sticnarf
force-pushed
the
consider-health
branch
3 times, most recently
from
May 24, 2022 08:34
f99eb84
to
b6dff0d
Compare
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
sticnarf
force-pushed
the
consider-health
branch
from
June 13, 2022 03:50
b6dff0d
to
9441839
Compare
MyonKeminta
approved these changes
Jun 13, 2022
youjiali1995
approved these changes
Jun 13, 2022
sticnarf
added a commit
to sticnarf/client-go
that referenced
this pull request
Jun 14, 2022
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
sticnarf
added a commit
to sticnarf/client-go
that referenced
this pull request
Jun 14, 2022
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
12 tasks
sticnarf
added a commit
to sticnarf/client-go
that referenced
this pull request
Jun 14, 2022
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
sticnarf
added a commit
to sticnarf/client-go
that referenced
this pull request
Jun 14, 2022
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
youjiali1995
pushed a commit
that referenced
this pull request
Jun 14, 2022
youjiali1995
pushed a commit
that referenced
this pull request
Jun 14, 2022
youjiali1995
pushed a commit
that referenced
this pull request
Jun 14, 2022
This was referenced Jun 15, 2022
12 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
It's an improvement for recovery time when hibernate region is enabled.
When we detect a TiKV store is unreachable, we only clear the region cache of regions on it. But it's not enough.
Considering one TiKV is unhealthy, all requests sending to that store will timeout. But due to hibernate region, the regions whose leaders are on the unhealthy store will not be re-elected until a request is sent to the follower.
If there are thousands of such regions, every time we are accessing a new region, it will send a request to the original leader on the unhealthy TiKV because the leader definitely does not change. And then, the user will always experience very long request duration until all regions are touched and elect new leaders.
So, this PR simply prevents sending requests to the leader that are on unhealthy TiKVs. To achieve this, the check loop is always enabled instead of only when forwarding is enabled.