-
Notifications
You must be signed in to change notification settings - Fork 725
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
*: refine code, decrease indent, and rename #8276
Conversation
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 #8276 +/- ##
==========================================
- Coverage 77.35% 77.32% -0.03%
==========================================
Files 470 471 +1
Lines 61376 61397 +21
==========================================
- Hits 47478 47476 -2
- Misses 10336 10365 +29
+ Partials 3562 3556 -6
Flags with carried forward coverage won't be shown. Click here to find out more. |
return ops | ||
if labelMgr.ScheduleDisabled(region) { | ||
denySchedulersByLabelerCounter.Inc() | ||
continue loop |
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.
Did we forget to update s.nextInterval = s.Scheduler.GetMinInterval()
when executing ops[0] successfully?
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.
L494
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.
maybe continue loop
will not pass 494?
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.
fixed in f1c1a1e
Seem the Reset
does not work
pd/pkg/schedule/schedulers/scheduler_controller.go
Lines 360 to 361 in c015f14
// Note: we reset the ticker here to support updating configuration dynamically. | |
ticker.Reset(s.GetInterval()) |
Interval
is fixed.
But it is not related to this 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.
Is it necessary to make this change?
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.
Did you mean the changes of this file or some others?
The changes of this file are:
- decrease indent for code readability
- use
continue loop
to instead withfoundDisabled
variable, this is more concise - no other updates
server/cluster/cluster.go
Outdated
storesSpeedGauge.WithLabelValues(storeAddress, storeLabel, action).Set(leftSeconds) | ||
storesETAGauge.WithLabelValues(storeAddress, storeLabel, action).Set(currentSpeed) |
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.
storesSpeedGauge.WithLabelValues(storeAddress, storeLabel, action).Set(leftSeconds) | |
storesETAGauge.WithLabelValues(storeAddress, storeLabel, action).Set(currentSpeed) | |
storesSpeedGauge.WithLabelValues(storeAddress, storeLabel, action).Set(currentSpeed) | |
storesETAGauge.WithLabelValues(storeAddress, storeLabel, action).Set(leftSeconds) |
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
// try regenerating operators | ||
if foundDisabled { | ||
region := s.cluster.GetRegion(op.RegionID()) | ||
if region == nil { | ||
continue |
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 find that if the region == nil, do we still need to count it in ops?
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.
pd/pkg/schedule/labeler/labeler.go
Line 324 in c015f14
if i, data := l.rangeList.GetData(region.GetStartKey(), region.GetEndKey()); i != -1 { |
seems it will be panic
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.
region == nil
means the ops are not normal right now, so can just retry
pkg/progress/progress.go
Outdated
@@ -201,39 +204,40 @@ func (m *Manager) GetProgresses(filter func(p string) bool) []string { | |||
m.RLock() | |||
defer m.RUnlock() | |||
|
|||
processes := []string{} | |||
progresses := []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.
progresses := []string{} | |
progresses := make([]string, 0, len(m.progresses)) |
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.
fixed in c107129
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JmPotato, rleungx The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/merge |
@JmPotato: We have migrated to builtin 👉 Please use
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?
Issue Number: Ref #4399
What is changed and how does it work?
Check List
Tests
Release note