api: change store limit by label#2697
Conversation
|
/run-all-tests |
There was a problem hiding this comment.
Can we make the rule as an option?
There was a problem hiding this comment.
You mean store limit (rule) (limit) (type)?
server/config/config.go
Outdated
There was a problem hiding this comment.
How do we distinguish StoreRuleLimit and StoreLimit? I think it is a bit complicated.
There was a problem hiding this comment.
Yes. If it is not exposed to users, then where to save the map(which is used when a new store comes)
There was a problem hiding this comment.
Yes,we can hide him and provide a separate API for the query. cc @rleungx
There was a problem hiding this comment.
Provide something like InternalConfig, which can be used in other scenarios like this. Some additional logic will be added to show config. Is it a good solution?
server/api/router.go
Outdated
There was a problem hiding this comment.
I more likely change rule to group? how do you think? We already have a placement rule, this Rule may confuse users.
There was a problem hiding this comment.
Actually, I prefer not to add a new API. we can make the rules as a parameter or option
server/config/config.go
Outdated
There was a problem hiding this comment.
Yes,we can hide him and provide a separate API for the query. cc @rleungx
server/config/config.go
Outdated
There was a problem hiding this comment.
Can we use a way like the store label API to parse the label?
|
I think we can use the original command to set the store limit but provide an option to use the label. e.g. |
|
Can we accelerate this PR? @ZenoTan |
|
Sure. Next week I'll work on this. |
|
Will open soon. |
Signed-off-by: ZenoTan <zenotan1998@gmail.com>
Signed-off-by: ZenoTan <zenotan1998@gmail.com>
Signed-off-by: ZenoTan <zenotan1998@gmail.com>
Signed-off-by: ZenoTan <zenotan1998@gmail.com>
| c.Assert(limit2, Equals, float64(25)) | ||
|
|
||
| // store limit all <key> <value> <rate> <type> | ||
| args = []string{"-u", pdAddr, "store", "limit", "all", "zone", "uk", "20", "remove-peer"} |
There was a problem hiding this comment.
can we add a simpler command for TiFlash? cc @rleungx
There was a problem hiding this comment.
Maybe store tiflash add-peer 60?
There was a problem hiding this comment.
we can do it in another PR.
| cmd.Println("Labels are an option of set all stores limit.") | ||
| } else { | ||
| postInput := map[string]interface{}{} | ||
| prefix := path.Join(storesPrefix, "limit") |
tests/pdctl/store/store_test.go
Outdated
| // store limit all <key> <value> <rate> <type> | ||
| args = []string{"-u", pdAddr, "store", "limit", "all", "zone", "uk", "20", "remove-peer"} | ||
| _, output, err = pdctl.ExecuteCommandC(cmd, args...) | ||
| c.Log(string(output)) |
Signed-off-by: ZenoTan <zenotan1998@gmail.com>
Signed-off-by: ZenoTan <zenotan1998@gmail.com>
|
/merge |
|
@ZenoTan Oops! auto merge is restricted to Committers of the SIG.See the corresponding SIG page for more information. Related SIG: scheduling(slack). |
|
/merge |
|
/run-all-tests |
|
@ZenoTan merge failed. |
|
/run-all-tests |
2 similar comments
|
/run-all-tests |
|
/run-all-tests |
|
/run-test |
|
/run-integration-lightning-test |
|
/test |
|
/rebuild |
|
/merge |
|
/run-all-tests |
What problem does this PR solve?
Solve issue #2568
ref: #2504
What is changed and how it works?
Support change store limit according to label. Label is treated as a special store rule here.
Command line like "store limit ... " can be used to change it.
Check List
Tests
Code changes
Side effects
Related changes
Release note