-
Notifications
You must be signed in to change notification settings - Fork 727
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
schedulers: decrease target filter calculate #4080
Conversation
[REVIEW NOTIFICATION] This pull request has not been approved. 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]>
4c344ed
to
da90262
Compare
Codecov ReportBase: 74.70% // Head: 74.85% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #4080 +/- ##
==========================================
+ Coverage 74.70% 74.85% +0.15%
==========================================
Files 260 260
Lines 26625 26632 +7
==========================================
+ Hits 19889 19936 +47
+ Misses 4950 4923 -27
+ Partials 1786 1773 -13
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@@ -53,14 +53,17 @@ type balancePlan struct { | |||
|
|||
sourceScore float64 | |||
targetScore float64 | |||
|
|||
excludeTarget []*core.StoreInfo |
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.
The generation and use of excludeTarget
has nothing to do with balancePlan
, I think it should be in balance_region.go
.
@@ -201,7 +205,7 @@ func (s *balanceRegionScheduler) Schedule(cluster opt.Cluster) []*operator.Opera | |||
continue | |||
} | |||
|
|||
if op := s.transferPeer(plan); op != nil { | |||
if op := s.transferPeer(plan, stores[index:]); op != 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.
Use sorted sourceStores
and targetStores
and indexSource
and indexTarget
.
@@ -137,22 +136,24 @@ func (s *balanceRegionScheduler) IsScheduleAllowed(cluster opt.Cluster) bool { | |||
} | |||
|
|||
func (s *balanceRegionScheduler) Schedule(cluster opt.Cluster) []*operator.Operator { | |||
storeState := &filter.StoreStateFilter{ActionScope: s.GetName(), MoveRegion: true} |
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 to be a constant.
filter.NewPlacementSafeguard(s.GetName(), plan.cluster, plan.region, plan.source), | ||
filter.NewRegionScoreFilter(s.GetName(), plan.source, plan.cluster.GetOpts()), |
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.
Where is NewRegionScoreFilter now?
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.
The score should sort once in source selection, and the targets's score must less than the source by index.
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.
Please remove NewRegionScoreFilter then.
@bufferflies: PR needs rebase. 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 kubernetes/test-infra repository. |
Outdated, ref #5544 |
What problem does this PR solve?
related #3744,remove some repeat target filter
What is changed and how it works?
scheduler move some target filter such as StoreStateFilter, RegionScoreFilter, SpecialFilter at scheduler start
Check List
Tests
origin
![image](https://user-images.githubusercontent.com/23159587/132174142-20672c78-97fa-4ccb-8bd2-ee999a6b433f.png)
this PR:
![image](https://user-images.githubusercontent.com/23159587/132174026-9319b6db-a79e-442e-8c0c-2e14d2052637.png)
import double performance
Code changes
Side effects
Related changes
Release note