-
Notifications
You must be signed in to change notification settings - Fork 728
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: do not balance the empty regions #3344
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3344 +/- ##
==========================================
- Coverage 74.94% 74.91% -0.04%
==========================================
Files 243 243
Lines 23245 23250 +5
==========================================
- Hits 17421 17417 -4
- Misses 4259 4265 +6
- Partials 1565 1568 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
server/schedulers/balance_region.go
Outdated
@@ -167,6 +171,13 @@ func (s *balanceRegionScheduler) Schedule(cluster opt.Cluster) []*operator.Opera | |||
} | |||
log.Debug("select region", zap.String("scheduler", s.GetName()), zap.Uint64("region-id", region.GetID())) | |||
|
|||
// Skip the empty region | |||
if region.GetApproximateSize() <= core.EmptyRegionApproximateSize && regionCount > balanceEmptyRegionThreshold { |
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 seems better to define a region filter and filter empty regions in Rand{Pending, Follower, Leader, Learner}Region
.
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: rleungx <rleungx@gmail.com>
17aeec9
to
718b0a3
Compare
Signed-off-by: Ryan Leung <rleungx@gmail.com>
718b0a3
to
8a44024
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
Signed-off-by: Ryan Leung <rleungx@gmail.com>
e513b6f
to
5219763
Compare
/merge |
@disksing: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests 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: 5219763
|
@rleungx: Your PR has out-of-dated, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests 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. |
What problem does this PR solve?
After
drop table
or such kind of operation, there might be a large number of empty regions which cannot be merged immediately. The balance region scheduler will balance them if the stores' size have the difference. In this case, it may cause a lot of balance operation which affect the performance.What is changed and how it works?
This PR will skip the empty region when selecting the region.
Check List
Tests
Release note