-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
store/tikv: always switch to a different peer when meets no-leader (#22449) #23595
store/tikv: always switch to a different peer when meets no-leader (#22449) #23595
Conversation
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
/run-all-tests |
@youjiali1995 you're already a collaborator in bot's repo. |
LGTM |
@cfzjywxk: Please use If you have approved this PR, please ignore this reply. This reply is being used as a temporary reply during the migration of the new bot and will be removed on April 1. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 09c1ef4
|
/run-common-test |
/run-unit-test |
cherry-pick #22449 to release-5.0
You can switch your code base to this Pull Request by using git-extras:
# In tidb repo: git pr https://github.com/pingcap/tidb/pull/23595
After apply modifications, you can push your change to this PR via:
Signed-off-by: youjiali1995 zlwgx1023@gmail.com
What problem does this PR solve?
Issue Number: close #22400
Problem Summary:
Joint consensus is enabled in master, which is possible to make a leader step down as a learner during a conf change. And hibernate region is also enabled by default in master, so after the leader step down, there can be a long time that there is no leader in the region until requests are sent to followers or hibernate timeout. But from logs, I can see TiDB keeps querying the learner instead of trying other followers, hence it keeps timeout until hibernate is woken up.
What is changed and how it works?
What's Changed:
One solution is always to try a different peer when meets no-leader. There is a small probability that the current peer who reports not-leader becomes a leader and TiDB has to retry once in this case.
Related changes
Check List
Tests
Release note