-
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
Changes from 2 commits
0cdc90c
9641180
7c3b792
467c36e
fcd72d2
807a828
2d2c299
610212a
e65b232
b3e6bd9
a0d9fd5
0133b1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. updated. |
||
"write-priorities": []interface{}{}, | ||
} | ||
c.Assert(conf, DeepEquals, expected1) | ||
mustExec([]string{"-u", pdAddr, "scheduler", "config", "balance-hot-region-scheduler", "set", "src-tolerance-ratio", "1.02"}, nil) | ||
|
@@ -277,6 +279,19 @@ func (s *schedulerTestSuite) TestScheduler(c *C) { | |
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"}, nil) | ||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
expected1["read-priorities"] = []interface{}{"key", "byte"} | ||
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", "none"}, nil) | ||
expected1["read-priorities"] = []interface{}{} | ||
mustExec([]string{"-u", pdAddr, "scheduler", "config", "balance-hot-region-scheduler"}, &conf1) | ||
c.Assert(conf1, DeepEquals, expected1) | ||
|
||
// test show scheduler with paused and disabled status. | ||
checkSchedulerWithStatusCommand := func(args []string, status string, expected []string) { | ||
if args != 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.
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:
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.