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

mcs: support scheduler config forward and enable some tests #7256

Merged
merged 8 commits into from
Nov 1, 2023

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Oct 25, 2023

What problem does this PR solve?

Issue Number: Ref #5839

What is changed and how does it work?

Check List

Tests

  • Unit test

Release note

None.

Signed-off-by: lhy1024 <admin@liudos.us>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Oct 25, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JmPotato
  • 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 bot added the release-note-none Denotes a PR that doesn't merit a release note. label Oct 25, 2023
@ti-chi-bot ti-chi-bot bot requested review from nolouch and rleungx October 25, 2023 16:46
@lhy1024 lhy1024 changed the title mcs: support scheduler config and enable some tests mcs: support scheduler config forward and enable some tests Oct 25, 2023
@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 25, 2023
@@ -160,8 +169,11 @@ func (suite *schedulerTestSuite) checkScheduler(cluster *tests.TestCluster) {
checkSchedulerCommand(args, expected)

// check update success
expectedConfig["store-id-ranges"] = map[string]interface{}{"2": []interface{}{map[string]interface{}{"end-key": "", "start-key": ""}}, "3": []interface{}{map[string]interface{}{"end-key": "", "start-key": ""}}}
checkSchedulerConfigCommand(expectedConfig, schedulers[idx])
// FIXME: remove this check after scheduler config is updated
Copy link
Contributor Author

@lhy1024 lhy1024 Oct 25, 2023

Choose a reason for hiding this comment

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

But scheduler handler in scheduling server cannot update config, such as grant-leader-scheduler, grant-hot-region-scheduler, balance-hot-region-scheduler, evict-slow-store-scheduler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

return schedulers, nil
// The default scheduler could not be deleted, it could only be disabled.
// TODO: Should we distinguish between disabled and removed schedulers?
var enabledSchedulers []string
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we distinguish between disabled and removed schedulers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After discussion, we will not distinguish them.

…region-scheduler, evict-slow-store-scheduler

Signed-off-by: lhy1024 <admin@liudos.us>
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 25, 2023
@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Merging #7256 (5d2cc9c) into master (ded917b) will decrease coverage by 0.04%.
The diff coverage is 59.77%.

@@            Coverage Diff             @@
##           master    #7256      +/-   ##
==========================================
- Coverage   74.42%   74.38%   -0.04%     
==========================================
  Files         446      446              
  Lines       48288    48339      +51     
==========================================
+ Hits        35939    35958      +19     
- Misses       9187     9192       +5     
- Partials     3162     3189      +27     
Flag Coverage Δ
unittests 74.38% <59.77%> (-0.04%) ⬇️

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

Signed-off-by: lhy1024 <admin@liudos.us>
Comment on lines 131 to 135
router.GET("/diagnostic/:name", getDiagnosticResult)
router.GET("/config/:name/:suffix", getSchedulerConfigByName)
// TODO: in the future, we should split pauseOrResumeScheduler to two different APIs.
// And we need to do one-to-two forwarding in the API middleware.
router.POST("/:name", pauseOrResumeScheduler)
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 unifying these formats?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about

router.GET("", getSchedulers)
router.GET("/:name", getDiagnosticResult)
router.POST("/:name", pauseOrResumeScheduler)
router.GET("/config/:name/:suffix", getSchedulerConfigByName)

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 using
router.GET("", getSchedulers)
router.GET("/:name/diagnose", getDiagnosticResult)
router.POST("/:name", pauseOrResumeScheduler)
router.GET("/:name/config", getSchedulerConfigByName)

Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 31, 2023
Comment on lines 135 to 136
router.GET("/config/:name/list", getSchedulerConfigByName)
router.GET("/config/:name/roles", getSchedulerConfigByName) // compatibility for shuffle-region-scheduler
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 these two?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, otherwise we'll modify shuffle region scheduler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unify to "/list" and use new api in pd-ctl

pkg/mcs/scheduling/server/apis/v1/api.go Show resolved Hide resolved
Signed-off-by: lhy1024 <admin@liudos.us>
@lhy1024
Copy link
Contributor Author

lhy1024 commented Nov 1, 2023

@rleungx @JmPotato ptal

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 1, 2023
@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 1, 2023
@JmPotato
Copy link
Member

JmPotato commented Nov 1, 2023

/merge

Copy link
Contributor

ti-chi-bot bot commented Nov 1, 2023

@JmPotato: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and 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.

If you have any questions about the PR merge process, please refer to pr process.

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.

Copy link
Contributor

ti-chi-bot bot commented Nov 1, 2023

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

Commit hash: 71da057

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 1, 2023
Copy link
Contributor

ti-chi-bot bot commented Nov 1, 2023

@lhy1024: Your PR was out of date, I have automatically updated it for you.

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 bot merged commit 4e45e95 into tikv:master Nov 1, 2023
24 of 26 checks passed
@lhy1024 lhy1024 deleted the sche-redirect7 branch November 1, 2023 06:44
rleungx pushed a commit to rleungx/pd that referenced this pull request Dec 1, 2023
ref tikv#5839

Signed-off-by: lhy1024 <admin@liudos.us>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. 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.

3 participants