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
cluster: Scheduler Dry Run mechanism #5283
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. |
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
4a6a6c5
to
45dafdb
Compare
Codecov Report
@@ Coverage Diff @@
## master #5283 +/- ##
==========================================
+ Coverage 75.77% 75.82% +0.05%
==========================================
Files 311 310 -1
Lines 30781 30805 +24
==========================================
+ Hits 23324 23358 +34
+ Misses 5463 5455 -8
+ Partials 1994 1992 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
server/cluster/coordinator.go
Outdated
type diagnosisManager struct { | ||
cluster *RaftCluster | ||
schedulers map[string]*scheduleController | ||
enableDiganose map[string]bool |
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.
What is it used for?
server/cluster/coordinator.go
Outdated
cluster *RaftCluster | ||
schedulers map[string]*scheduleController | ||
enableDiganose map[string]bool | ||
dryRunResult map[string]*diagnosisResult |
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 think the results can be a slice. The diagnosisResult
should have a timestamp.
server/cluster/coordinator.go
Outdated
|
||
type diagnosisResult struct { | ||
result []plan.Plan | ||
ops []*operator.Operator |
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 we need ops?
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
server/cluster/coordinator.go
Outdated
plans []plan.Plan | ||
schedulablePlan []plan.Plan |
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.
What is the difference between schedulablePlan
and plans
?
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 change the name
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
server/cluster/coordinator.go
Outdated
|
||
func (d *diagnosisManager) diagnosisDryRun(name string) error { | ||
if _, ok := d.schedulers[name]; !ok { | ||
return errors.Errorf("no scheduler named %s", name) |
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:
return errors.Errorf("no scheduler named %s", name) | |
return errs.ErrSchedulerNotFound.FastGenByArgs() |
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 rest LGTM.
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
/merge |
@rleungx: 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: 6b5cd2b
|
@CabinfeverB: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. 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 #5257
What is changed and how does it work?
add a new struct named
diagnosisManager
andcoordinator
have it.diagnosisManager
will share scheduler withcoordinator
.Check List
Tests
Release note