-
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
checker: unify checker name and checker type #8316
Conversation
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
pkg/schedule/filter/counter.go
Outdated
@@ -83,8 +83,8 @@ var scopes = [scopeLen]string{ | |||
|
|||
"evict-leader-scheduler", | |||
"region-scatter", | |||
"replica-checker", | |||
"rule-checker", | |||
"replica_checker", |
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 unify the -
and _
?
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.
Yes, scheduler will be unified in the next pr~
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 monitor might also need to be changed.
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.
Do you mean the checker's monitor?
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'm not sure about that, maybe scheduler or maybe checker
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 scheduler name has not been changed.
The checker monitor is no need to change, after I checked. They are all in the form of xxx_checker.
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.
Just a reminder
Signed-off-by: okJiang <[email protected]>
/cc @lhy1024 |
pkg/schedule/checker/rule_checker.go
Outdated
@@ -404,7 +403,7 @@ func (c *RuleChecker) allowLeader(fit *placement.RegionFit, peer *metapb.Peer) b | |||
if s == nil { | |||
return false | |||
} | |||
stateFilter := &filter.StoreStateFilter{ActionScope: "rule-checker", TransferLeader: true} | |||
stateFilter := &filter.StoreStateFilter{ActionScope: "rule_checker", TransferLeader: 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.
Will it affect the monitor?
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.
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 become xxx_checker-store which mixes hyphen and underscore?
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.
Indeed. We want to use underscores in the code and hyphens for monitoring, right?
Waiting for confirmation~
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.
IMO, it's better to use hyphens in the monitor.
pkg/schedule/checker/rule_checker.go
Outdated
@@ -108,7 +107,7 @@ func NewRuleChecker(ctx context.Context, cluster sche.CheckerCluster, ruleManage | |||
|
|||
// GetType returns RuleChecker's Type | |||
func (*RuleChecker) GetType() string { | |||
return ruleCheckerName | |||
return config.RuleCheckerName.String() |
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.
After this PR, the type will be changed from xx-xx to xx_xx. It might affect the current monitor.
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.
pkg/schedule/operator/metrics.go
Outdated
// IncOperatorLimitCounter increases the counter of operator meeting limit. | ||
func IncOperatorLimitCounter(typ, name string) { | ||
operatorLimitCounter.WithLabelValues( | ||
strings.ReplaceAll(typ, "_", "-"), name).Inc() |
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.
Is it possible not to replace it every time?
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.
Is it for performance reasons? In that case, we still need to cache one more xxxx-xxxx for monitoring, which brings us back to the original issue.
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 map to do this?
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.
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
/hold Need to be discuss |
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
EvictLeaderName config.CheckerSchedulerName = "user-evict-leader-scheduler" | ||
noStoreInSchedulerInfo = "No store in user-evict-leader-scheduler-config" | ||
) | ||
const noStoreInSchedulerInfo = "No store in user-evict-leader-scheduler-config" |
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.
no need to define a constant
BTW, this PR is too large to review. Is it possible to split them? |
After the ci pass, I will try it. But I still have to say, splitting is really tough😭 @rleungx |
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8316 +/- ##
==========================================
- Coverage 77.31% 77.16% -0.15%
==========================================
Files 470 471 +1
Lines 61681 61688 +7
==========================================
- Hits 47686 47600 -86
- Misses 10405 10501 +96
+ Partials 3590 3587 -3
Flags with carried forward coverage won't be shown. Click here to find out more. |
[FORMAT CHECKER NOTIFICATION] Notice: To remove the 📖 For more info, you can check the "Linking issues" section in the CONTRIBUTING.md. |
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. |
What problem does this PR solve?
Issue Number:
Ref #5845Ref #8379What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs
/pingcap/docs-cn
:pingcap/tiup
:Release note