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

schedule: fix scheduler removes region leader (#1462) #1469

Merged
merged 1 commit into from
Mar 20, 2019

Conversation

disksing
Copy link
Contributor

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

  • Unit test

Related changes

  • Need to cherry-pick to the release branch
  • Need to be included in the release notes

* schedule: fix scheduler removes region leader

Signed-off-by: disksing <i@disksing.com>
@disksing disksing added type/bug The issue is confirmed as a bug. cherry-pick component/schedule Scheduling logic. labels Mar 20, 2019
@disksing disksing requested a review from nolouch March 20, 2019 07:08
@disksing
Copy link
Contributor Author

/run-all-tests tidb=release-2.1 tikv=release-2.1 tidb-test=release-2.1

@disksing disksing merged commit 2287d9e into tikv:release-2.1 Mar 20, 2019
@disksing disksing deleted the pick-1462-1 branch March 20, 2019 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/schedule Scheduling logic. type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants