-
Notifications
You must be signed in to change notification settings - Fork 720
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
cluster: handle region after report split #6867
Conversation
Signed-off-by: bufferflies <[email protected]>
[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 submitting an approval review. |
Signed-off-by: bufferflies <[email protected]>
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.
ci failed
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.
Can we add some comment to show the difference processRegionSplit needs to do less than processRegionHeartbeat
Signed-off-by: bufferflies <[email protected]>
continue | ||
} | ||
// region split initiator store will be leader with a high probability | ||
leader := region.Peers[0] |
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.
Will it cause the balance leader to wrong place?
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.
good catch.
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.
I will mark this store as split store
and balance region scheduler doesn't pick this store as target store.
Signed-off-by: bufferflies <[email protected]>
Signed-off-by: bufferflies <[email protected]>
Signed-off-by: bufferflies <[email protected]>
Signed-off-by: bufferflies <[email protected]>
e680dc0
to
b2931c7
Compare
Codecov Report
@@ Coverage Diff @@
## master #6867 +/- ##
==========================================
+ Coverage 74.29% 74.48% +0.19%
==========================================
Files 440 440
Lines 47150 47195 +45
==========================================
+ Hits 35030 35154 +124
+ Misses 9022 8969 -53
+ Partials 3098 3072 -26
Flags with carried forward coverage won't be shown. Click here to find out more. |
Signed-off-by: bufferflies <[email protected]>
55bfddf
to
f2a01b2
Compare
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.
rest LGTM
@@ -486,7 +486,8 @@ func (l *balanceLeaderScheduler) transferLeaderOut(solver *solver, collector *pl | |||
// the worst follower peer and transfers the leader. | |||
func (l *balanceLeaderScheduler) transferLeaderIn(solver *solver, collector *plan.Collector) *operator.Operator { | |||
solver.Region = filter.SelectOneRegion(solver.RandFollowerRegions(solver.TargetStoreID(), l.conf.Ranges), | |||
nil, filter.NewRegionPendingFilter(), filter.NewRegionDownFilter()) | |||
nil, filter.NewRegionPendingFilter(), filter.NewRegionDownFilter(), | |||
filter.NewStoreRecentlySplitFilter(solver.GetStores())) |
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.
we can avoid to create a new filter every time
Signed-off-by: bufferflies <[email protected]>
@@ -184,6 +183,7 @@ func newBalanceLeaderScheduler(opController *operator.Controller, conf *balanceL | |||
&filter.StoreStateFilter{ActionScope: s.GetName(), TransferLeader: true, ForbidRecentlySplitRegions: true, OperatorLevel: constant.High}, | |||
filter.NewSpecialUseFilter(s.GetName()), | |||
} | |||
s.regionFilters = filter.NewStoreRecentlySplitFilter(opController.GetCluster().GetStores()) |
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 should be created in Schedule()
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.
good catch , has fixed
Signed-off-by: bufferflies <[email protected]>
changed := &core.RegionChanged{ | ||
IsNew: true, SaveKV: true, SaveCache: true, NeedSync: true, | ||
} | ||
if err := c.SaveRegion(region, changed); err != nil { |
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.
What if the new split region has been heartbeat to pd then the receive the report split? I think we need check the chagned
should it be saved.
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 can't be hapend. Tikv send this request before the region init.
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.
@bufferflies network is unexpected. and they are not in the same stream.
/run-check-issue-triage-complete |
Signed-off-by: bufferflies <[email protected]>
please fixed |
Signed-off-by: bufferflies <[email protected]>
b0a5348
to
8df5867
Compare
/merge |
@bufferflies: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
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. |
This pull request has been accepted and is ready to merge. Commit hash: 8df5867
|
@bufferflies: Your PR was out of date, I have automatically updated it for you. If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. 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. |
This reverts commit a997316.
This reverts commit a997316. Signed-off-by: Ryan Leung <[email protected]>
close #7133 Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: bufferflies [email protected]
What problem does this PR solve?
Issue Number: close #4157 and close tikv/tikv#15210
What is changed and how it works?
put region after batch report split
Check List
Tests
Code changes
Side effects
Related changes
Release note