Skip to content
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

Merged
merged 5 commits into from Jul 13, 2022

Conversation

CabinfeverB
Copy link
Member

@CabinfeverB CabinfeverB commented Jul 7, 2022

What problem does this PR solve?

Issue Number: ref #5257

What is changed and how does it work?

add a new struct named diagnosisManager and coordinator have it. diagnosisManagerwill share scheduler with coordinator.

Check List

Tests

  • Unit test

Release note

None.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 7, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • nolouch
  • rleungx

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/needs-linked-issue release-note The PR should write the release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jul 7, 2022
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
@codecov
Copy link

codecov bot commented Jul 7, 2022

Codecov Report

Merging #5283 (6b5cd2b) into master (3a51a52) will increase coverage by 0.05%.
The diff coverage is 82.14%.

❗ Current head 6b5cd2b differs from pull request most recent head a30b24a. Consider uploading reports for the commit a30b24a to get more accurate results

@@            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     
Flag Coverage Δ
unittests 75.82% <82.14%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/cluster/coordinator.go 72.49% <82.14%> (+1.64%) ⬆️
server/tso/local_allocator.go 71.62% <0.00%> (-6.76%) ⬇️
pkg/etcdutil/etcdutil.go 84.88% <0.00%> (-3.49%) ⬇️
server/schedule/labeler/rules.go 87.50% <0.00%> (-2.28%) ⬇️
server/config/persist_options.go 93.03% <0.00%> (-1.05%) ⬇️
server/election/leadership.go 77.31% <0.00%> (-1.04%) ⬇️
server/cluster/cluster.go 83.54% <0.00%> (-0.92%) ⬇️
server/server.go 74.13% <0.00%> (ø)
server/schedule/region_scatterer.go 79.83% <0.00%> (ø)
server/schedule/plan/status.go
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a51a52...a30b24a. Read the comment docs.

@CabinfeverB CabinfeverB requested a review from rleungx July 7, 2022 10:06
type diagnosisManager struct {
cluster *RaftCluster
schedulers map[string]*scheduleController
enableDiganose map[string]bool
Copy link
Member

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?

cluster *RaftCluster
schedulers map[string]*scheduleController
enableDiganose map[string]bool
dryRunResult map[string]*diagnosisResult
Copy link
Member

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.


type diagnosisResult struct {
result []plan.Plan
ops []*operator.Operator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need ops?

@CabinfeverB CabinfeverB changed the title Diagnose dryrun cluster: Scheduler Dry Run mechanism Jul 8, 2022
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Comment on lines 977 to 978
plans []plan.Plan
schedulablePlan []plan.Plan
Copy link
Member

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?

Copy link
Member Author

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>
@ti-chi-bot ti-chi-bot added release-note-none and removed do-not-merge/needs-linked-issue release-note The PR should write the release note. labels Jul 11, 2022
@CabinfeverB CabinfeverB marked this pull request as ready for review July 11, 2022 03:32
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 11, 2022
@CabinfeverB CabinfeverB requested review from AndreMouche and removed request for disksing July 11, 2022 05:46

func (d *diagnosisManager) diagnosisDryRun(name string) error {
if _, ok := d.schedulers[name]; !ok {
return errors.Errorf("no scheduler named %s", name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

Suggested change
return errors.Errorf("no scheduler named %s", name)
return errs.ErrSchedulerNotFound.FastGenByArgs()

Copy link
Member

@rleungx rleungx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest LGTM.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 12, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 12, 2022
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
@rleungx
Copy link
Member

rleungx commented Jul 13, 2022

/merge

@ti-chi-bot
Copy link
Member

@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.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 6b5cd2b

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 13, 2022
@ti-chi-bot
Copy link
Member

@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.

@ti-chi-bot ti-chi-bot merged commit 1f5dcb3 into tikv:master Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants