-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
*: Introduce runaway statement in resource group #43843
*: Introduce runaway statement in resource group #43843
Conversation
Signed-off-by: Cabinfever_B <[email protected]>
[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. |
Skipping CI for Draft Pull Request. |
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
734155a
to
4022180
Compare
Signed-off-by: Cabinfever_B <[email protected]>
parser/parser_test.go
Outdated
@@ -3700,6 +3701,16 @@ func TestDDL(t *testing.T) { | |||
{"create resource group x ru_per_sec=3000 burstable", true, "CREATE RESOURCE GROUP `x` RU_PER_SEC = 3000 BURSTABLE"}, | |||
{"create resource group x burstable ru_per_sec=4000", true, "CREATE RESOURCE GROUP `x` BURSTABLE RU_PER_SEC = 4000"}, | |||
{"create resource group x ru_per_sec=20, priority=LOW, burstable", true, "CREATE RESOURCE GROUP `x` RU_PER_SEC = 20 PRIORITY = LOW BURSTABLE"}, | |||
{"create resource group x ru_per_sec=1000 QUERY LIMIT EXEC_ELAPSED_IN_SEC '10s' ACTION DRYRUN", true, "CREATE RESOURCE GROUP `x` RU_PER_SEC = 1000 QUERY LIMIT EXEC_ELAPSED_IN_SEC = '10s' ACTION DRYRUN"}, |
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.
IMO, I would like to make all runaway spec into one option, it looks more layered. example:
create resource group x ru_per_sec=1000 RUNAWAY_QUERY='{ LIMIT_EXEC_ELAPSED_IN_SEC="10s", ACTION=KILL}'
cc @songrijie
Signed-off-by: Cabinfever_B <[email protected]>
/test unit-test |
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
5be5068
to
aea01dd
Compare
parser/ast/ddl.go
Outdated
@@ -2156,8 +2158,62 @@ func (n *ResourceGroupOption) Restore(ctx *format.RestoreCtx) error { | |||
ctx.WriteString(n.StrValue) | |||
case ResourceBurstableOpiton: | |||
ctx.WriteKeyWord("BURSTABLE") | |||
case ResourceGroupRunaway: | |||
if len(n.ResourceGroupRunawayOptionList) > 0 { | |||
ctx.WritePlain("QUERY_LIMIT=(") |
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.
ctx.WritePlain("QUERY_LIMIT=(") | |
ctx.WriteKeyWord("QUERY_LIMIT") | |
ctx.WritePlain(" = (") |
parser/model/model.go
Outdated
) | ||
|
||
// RunawayWatchValueToName converts the runaway watch value to corresponding name | ||
func RunawayWatchValueToName(value int32) string { |
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.
func RunawayWatchValueToName(value int32) string { | |
func (t RunawayWatchType) String() string { |
parser/parser_test.go
Outdated
@@ -3710,6 +3711,19 @@ func TestDDL(t *testing.T) { | |||
{"create resource group x ru_per_sec=3000 burstable", true, "CREATE RESOURCE GROUP `x` RU_PER_SEC = 3000 BURSTABLE"}, | |||
{"create resource group x burstable ru_per_sec=4000", true, "CREATE RESOURCE GROUP `x` BURSTABLE RU_PER_SEC = 4000"}, | |||
{"create resource group x ru_per_sec=20, priority=LOW, burstable", true, "CREATE RESOURCE GROUP `x` RU_PER_SEC = 20 PRIORITY = LOW BURSTABLE"}, | |||
{"create resource group x ru_per_sec=1000 QUERY_LIMIT=(EXEC_ELAPSED_IN_SEC '10s' ACTION DRYRUN)", true, "CREATE RESOURCE GROUP `x` RU_PER_SEC = 1000 QUERY_LIMIT=(EXEC_ELAPSED_IN_SEC = '10s' ACTION DRYRUN)"}, |
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 output format is not consistent with each other, (EXEC_ELAPSED_IN_SEC = '10s' ACTION DRYRUN)
should be (EXEC_ELAPSED_IN_SEC = '10s' ACTION = DRYRUN)
ctx.WriteKeyWord(model.RunawayWatchValueToName(n.IntValue)) | ||
ctx.WritePlain(" ") | ||
ctx.WriteKeyWord("DURATION ") | ||
ctx.WritePlain("= ") |
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.
should after WATCH
instead of DURATION
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 50de0c7
|
Signed-off-by: Cabinfever_B <[email protected]>
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 6edb215
|
What problem does this PR solve?
Issue Number: ref #43691
Problem Summary:
What is changed and how it works?
After pingcap/kvproto#1122, replace glog goleak function name
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.