-
Notifications
You must be signed in to change notification settings - Fork 719
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
scheduler: support multi priorities api for hot-region-scheduler #3899
Conversation
Signed-off-by: yisaer <disxiaofei@163.com>
Signed-off-by: yisaer <disxiaofei@163.com>
expected1["read-priorities"] = []interface{}{"key"} | ||
mustExec([]string{"-u", pdAddr, "scheduler", "config", "balance-hot-region-scheduler"}, &conf1) | ||
c.Assert(conf1, DeepEquals, expected1) | ||
mustExec([]string{"-u", pdAddr, "scheduler", "config", "balance-hot-region-scheduler", "set", "read-priorities", "key,byte"}, nil) |
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 will happen to it if the string is empty or otherwise unparseable?
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.
updated
Signed-off-by: yisaer <disxiaofei@163.com>
Codecov Report
@@ Coverage Diff @@
## master #3899 +/- ##
==========================================
- Coverage 74.56% 74.49% -0.08%
==========================================
Files 246 246
Lines 24868 24885 +17
==========================================
- Hits 18543 18537 -6
- Misses 4670 4687 +17
- Partials 1655 1661 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: yisaer <disxiaofei@163.com>
Signed-off-by: yisaer <disxiaofei@163.com>
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
@@ -30,6 +30,15 @@ import ( | |||
"github.com/unrolled/render" | |||
) | |||
|
|||
const ( | |||
// NonePriority indicates there is no dim priority for hot-region-scheduler | |||
NonePriority = "" |
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 that it might be disturbing for users to think that None means no priority, meaning that each dimension has the same priority
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 our current implement already has priority, it looks:
read-priorities [key, byte]
write-priorities [btye, key]
am I right?
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.
updated.
@@ -269,6 +269,8 @@ func (s *schedulerTestSuite) TestScheduler(c *C) { | |||
"minor-dec-ratio": 0.99, | |||
"src-tolerance-ratio": 1.05, | |||
"dst-tolerance-ratio": 1.05, | |||
"read-priorities": []interface{}{}, |
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.
Perhaps, we can use a default priority.
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.
updated.
Signed-off-by: yisaer <disxiaofei@163.com>
f4b136b
to
807a828
Compare
Signed-off-by: yisaer <disxiaofei@163.com>
Signed-off-by: yisaer <disxiaofei@163.com>
priorities := make([]string, 0) | ||
for _, priority := range strings.Split(value, ",") { | ||
if priority != schedulers.BytePriority && priority != schedulers.KeyPriority { | ||
cmd.Println(fmt.Sprintf("priority should be one of %s,%s,%s", |
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.
no need none anymore?
Signed-off-by: yisaer <disxiaofei@163.com>
Signed-off-by: yisaer <disxiaofei@163.com>
prioritiesMap := make(map[string]struct{}, 0) | ||
for _, priority := range strings.Split(value, ",") { | ||
if priority != schedulers.BytePriority && priority != schedulers.KeyPriority { | ||
cmd.Println(fmt.Sprintf("priority should be one of %s,%s", |
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
cmd.Println(fmt.Sprintf("priority should be one of %s,%s", | |
cmd.Println(fmt.Sprintf("priority should be one of [%s, %s]", |
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
[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: yisaer <disxiaofei@163.com>
/merge |
@Yisaer: 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: a0d9fd5
|
Signed-off-by: yisaer disxiaofei@163.com
What problem does this PR solve?
What is changed and how it works?
Support the api for priorities for balance-hot-region-scheduler
Check List
Tests
Release note