-
Notifications
You must be signed in to change notification settings - Fork 726
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
schedule: fix scheduler removes region leader #1462
Conversation
Signed-off-by: disksing <i@disksing.com>
Codecov Report
@@ Coverage Diff @@
## master #1462 +/- ##
==========================================
- Coverage 67.8% 67.39% -0.41%
==========================================
Files 158 158
Lines 15262 15322 +60
==========================================
- Hits 10348 10327 -21
- Misses 4003 4060 +57
- Partials 911 935 +24
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/rebuild |
* schedule: fix scheduler removes region leader Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
What problem does this PR solve?
Normally, PD avoids removing leader directly when scheduling. When the leader needs to be removed, the PD inserts a transfer leader step. However, when the number of replica is set to 1, this scheme does not attempt to transfer the leader to the peer that will be created, resulting in the direct remove of the leader.
What is changed and how it works?
Constructs a list based on the current peers and the peer to be added, then looks for the target of the transferLeader in the list. If target is not found, it returns an error to cancel the schedule process.
Check List
Tests
Related changes