-
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
mcs: dynamic enable scheduling jobs #7325
Conversation
[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. |
Skipping CI for Draft Pull Request. |
65f4a45
to
9ca0d80
Compare
7c6b012
to
1271686
Compare
schedulerStatusGauge.Reset() | ||
ruleStatusGauge.Reset() | ||
// create in map again | ||
rulesCntStatusGauge = ruleStatusGauge.WithLabelValues("rule_count") | ||
groupsCntStatusGauge = ruleStatusGauge.WithLabelValues("group_count") | ||
ruleStatusGauge.WithLabelValues("rule_count").Set(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.
Why Set(0)
after Reset
tests/server/cluster/cluster_test.go
Outdated
@@ -1562,6 +1562,7 @@ func TestTransferLeaderBack(t *testing.T) { | |||
svr := leaderServer.GetServer() | |||
rc := cluster.NewRaftCluster(ctx, svr.ClusterID(), syncer.NewRegionSyncer(svr), svr.GetClient(), svr.GetHTTPClient()) | |||
rc.InitCluster(svr.GetAllocator(), svr.GetPersistOptions(), svr.GetStorage(), svr.GetBasicCluster(), svr.GetHBStreams(), svr.GetKeyspaceGroupManager()) | |||
rc.SchedulingController = cluster.NewSchedulingController(ctx, rc.GetBasicCluster(), rc.GetOpts(), rc.GetRuleManager()) |
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 putting the initialization of SchedulingController
into InitCluster
? This way we can avoid one less function call and avoid forgetting
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 doesn't init RuleManager.
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.
Also put the initialization of RuleManager
into InitCluster?
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.
done
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 remove it now
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
54af163
to
fce7646
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #7325 +/- ##
==========================================
- Coverage 74.27% 74.19% -0.09%
==========================================
Files 451 451
Lines 48967 49044 +77
==========================================
+ Hits 36372 36387 +15
- Misses 9375 9441 +66
+ Partials 3220 3216 -4
Flags with carried forward coverage won't be shown. Click here to find out 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.
rest LGTM!
tests/server/cluster/cluster_test.go
Outdated
@@ -1562,6 +1562,7 @@ func TestTransferLeaderBack(t *testing.T) { | |||
svr := leaderServer.GetServer() | |||
rc := cluster.NewRaftCluster(ctx, svr.ClusterID(), syncer.NewRegionSyncer(svr), svr.GetClient(), svr.GetHTTPClient()) | |||
rc.InitCluster(svr.GetAllocator(), svr.GetPersistOptions(), svr.GetStorage(), svr.GetBasicCluster(), svr.GetHBStreams(), svr.GetKeyspaceGroupManager()) | |||
rc.SchedulingController = cluster.NewSchedulingController(ctx, rc.GetBasicCluster(), rc.GetOpts(), rc.GetRuleManager()) |
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 remove it now
) | ||
|
||
type schedulingController struct { | ||
// SchedulingController is used to manage all schedulers and checkers. | ||
type SchedulingController struct { |
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.
And maybe we can keep unexported :)
@@ -52,26 +56,23 @@ type schedulingController struct { | |||
running bool | |||
} | |||
|
|||
func newSchedulingController(parentCtx context.Context) *schedulingController { | |||
// NewSchedulingController creates a new scheduling controller. | |||
func NewSchedulingController(parentCtx context.Context, basicCluster *core.BasicCluster, opt sc.ConfProvider, ruleManager *placement.RuleManager) *SchedulingController { |
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.
ditto
Signed-off-by: Ryan Leung <rleungx@gmail.com>
677c6a3
to
e643d7d
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.
LGTM. Do we need a manual test for it?
Yes, will do more tests later. |
@nolouch PTAL |
/merge |
@rleungx: 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: 013577b
|
What problem does this PR solve?
Issue Number: Ref #5839. Also close #7375.
What is changed and how does it work?
This PR supports dynamic enable/disable scheduling service.
Check List
Tests
Release note