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

*: Introduce runaway statement in resource group #43843

Merged
merged 27 commits into from
May 31, 2023

Conversation

CabinfeverB
Copy link
Contributor

@CabinfeverB CabinfeverB commented May 15, 2023

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

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot
Copy link

ti-chi-bot bot commented May 15, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • hawkingrei
  • qw4990

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
Copy link

ti-chi-bot bot commented May 15, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 15, 2023
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
@ti-chi-bot ti-chi-bot bot removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. do-not-merge/needs-linked-issue labels May 15, 2023
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 16, 2023
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
@CabinfeverB CabinfeverB marked this pull request as ready for review May 23, 2023 07:41
@ti-chi-bot ti-chi-bot bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 23, 2023
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]>
@CabinfeverB CabinfeverB force-pushed the resource_manager/runaway_ruke branch from 734155a to 4022180 Compare May 23, 2023 09:26
Signed-off-by: Cabinfever_B <[email protected]>
@CabinfeverB
Copy link
Contributor Author

cc @glorv @nolouch @Connor1996

@@ -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"},
Copy link
Member

@nolouch nolouch May 24, 2023

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

@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 30, 2023
Signed-off-by: Cabinfever_B <[email protected]>
@ti-chi-bot ti-chi-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 30, 2023
@CabinfeverB
Copy link
Contributor Author

/test unit-test

Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
@CabinfeverB CabinfeverB requested a review from a team as a code owner May 30, 2023 14:47
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
@CabinfeverB CabinfeverB force-pushed the resource_manager/runaway_ruke branch from 5be5068 to aea01dd Compare May 31, 2023 05:03
@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 31, 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 May 31, 2023
@@ -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=(")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ctx.WritePlain("QUERY_LIMIT=(")
ctx.WriteKeyWord("QUERY_LIMIT")
ctx.WritePlain(" = (")

)

// RunawayWatchValueToName converts the runaway watch value to corresponding name
func RunawayWatchValueToName(value int32) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
func RunawayWatchValueToName(value int32) string {
func (t RunawayWatchType) String() string {

@@ -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)"},
Copy link
Contributor

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("= ")
Copy link
Member

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]>
@glorv
Copy link
Contributor

glorv commented May 31, 2023

/merge

@ti-chi-bot
Copy link

ti-chi-bot bot commented May 31, 2023

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

Commit hash: 50de0c7

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label May 31, 2023
Signed-off-by: Cabinfever_B <[email protected]>
@ti-chi-bot ti-chi-bot bot removed the status/can-merge Indicates a PR has been approved by a committer. label May 31, 2023
@glorv
Copy link
Contributor

glorv commented May 31, 2023

/merge

@ti-chi-bot
Copy link

ti-chi-bot bot commented May 31, 2023

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

Commit hash: 6edb215

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label May 31, 2023
@ti-chi-bot ti-chi-bot bot merged commit 4c83352 into pingcap:master May 31, 2023
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.

6 participants