-
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
scheduler: fix region scatter may transfer leader to removed peer #1482
Conversation
Signed-off-by: nolouch <nolouch@gmail.com>
@nolouch The log you provided does not transfer leader to removed peer. The steps are:
|
@disksing I update the log, this one is pick from test cluster. |
@nolouch CI failed. |
Signed-off-by: nolouch <nolouch@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #1482 +/- ##
========================================
Coverage ? 67.4%
========================================
Files ? 158
Lines ? 15454
Branches ? 0
========================================
Hits ? 10417
Misses ? 4092
Partials ? 945
Continue to review full report at Codecov.
|
server/schedule/region_scatterer.go
Outdated
steps := make([]OperatorStep, 0, len(targetPeers)*2+1) | ||
deferSteps := make([]OperatorStep, 0, 2) | ||
var kind OperatorKind | ||
sameLeader := targetLeaderPeer.GetStoreId() == origin.GetLeader().GetStoreId() |
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.
How about using a variable for origin.GetLeader().GetStoreId()
server/schedule/region_scatterer.go
Outdated
|
||
storeIDs := origin.GetStoreIds() | ||
steps := make([]OperatorStep, 0, len(targetPeers)*2+1) | ||
deferSteps := make([]OperatorStep, 0, 2) |
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.
It's better to add some comments to explain why we put these steps in the end.
Signed-off-by: nolouch <nolouch@gmail.com>
…kv#1482) * scheduler: fix region scatter may transfer leader to removed peer Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: nolouch nolouch@gmail.com
What problem does this PR solve?
Somtimes region scatter may timeout, it cause by:
log like:
the origin leader is on store 7.
What is changed and how it works?
Fix the operator create logic.
Check List
Tests