Skip to content

resource_control: support unlimited keyword when setting the resource group#54704

Merged
ti-chi-bot[bot] merged 6 commits into
pingcap:masterfrom
HuSharp:add_ru_unlimited
Jul 26, 2024
Merged

resource_control: support unlimited keyword when setting the resource group#54704
ti-chi-bot[bot] merged 6 commits into
pingcap:masterfrom
HuSharp:add_ru_unlimited

Conversation

@HuSharp
Copy link
Copy Markdown
Contributor

@HuSharp HuSharp commented Jul 18, 2024

What problem does this PR solve?

Issue Number: close #54413

Problem Summary:

What changed and how does it work?

mysql> SELECT * FROM information_schema.resource_groups;
+---------+------------+----------+-----------+-------------+------------+
| NAME    | RU_PER_SEC | PRIORITY | BURSTABLE | QUERY_LIMIT | BACKGROUND |
+---------+------------+----------+-----------+-------------+------------+
| default | UNLIMITED  | MEDIUM   | YES       | NULL        | NULL       |
+---------+------------+----------+-----------+-------------+------------+
1 row in set (0.00 sec)

mysql> CREATE RESOURCE GROUP IF NOT EXISTS rg1   RU_PER_SEC = 100   BURSTABLE;
Query OK, 0 rows affected (0.07 sec)

mysql> CREATE RESOURCE GROUP IF NOT EXISTS rg2   RU_PER_SEC = unlimited   BURSTABLE;
Query OK, 0 rows affected (0.06 sec)

mysql> CREATE RESOURCE GROUP IF NOT EXISTS rg3   RU_PER_SEC = UNLIMITED   BURSTABLE;
Query OK, 0 rows affected (0.07 sec)

mysql> SELECT * FROM information_schema.resource_groups;
+---------+------------+----------+-----------+-------------+------------+
| NAME    | RU_PER_SEC | PRIORITY | BURSTABLE | QUERY_LIMIT | BACKGROUND |
+---------+------------+----------+-----------+-------------+------------+
| default | UNLIMITED  | MEDIUM   | YES       | NULL        | NULL       |
| rg1     | 100        | MEDIUM   | YES       | NULL        | NULL       |
| rg2     | UNLIMITED  | MEDIUM   | YES       | NULL        | NULL       |
| rg3     | UNLIMITED  | MEDIUM   | YES       | NULL        | NULL       |
+---------+------------+----------+-----------+-------------+------------+
4 rows in set (0.00 sec)

mysql> ALTER RESOURCE GROUP rg2 RU_PER_SEC = 200;
Query OK, 0 rows affected (0.05 sec)

mysql> SELECT * FROM information_schema.resource_groups;
+---------+------------+----------+-----------+-------------+------------+
| NAME    | RU_PER_SEC | PRIORITY | BURSTABLE | QUERY_LIMIT | BACKGROUND |
+---------+------------+----------+-----------+-------------+------------+
| default | UNLIMITED  | MEDIUM   | YES       | NULL        | NULL       |
| rg1     | 100        | MEDIUM   | YES       | NULL        | NULL       |
| rg2     | 200        | MEDIUM   | YES       | NULL        | NULL       |
| rg3     | UNLIMITED  | MEDIUM   | YES       | NULL        | NULL       |
+---------+------------+----------+-----------+-------------+------------+
4 rows in set (0.00 sec)

mysql> CREATE RESOURCE GROUP IF NOT EXISTS rg4   RU_PER_SEC = UNLIMITED   BURSTABLE=FALSE;
Query OK, 0 rows affected (0.06 sec)

mysql> SELECT * FROM information_schema.resource_groups;
+---------+------------+----------+-----------+-------------+------------+
| NAME    | RU_PER_SEC | PRIORITY | BURSTABLE | QUERY_LIMIT | BACKGROUND |
+---------+------------+----------+-----------+-------------+------------+
| default | UNLIMITED  | MEDIUM   | YES       | NULL        | NULL       |
| rg1     | 100        | MEDIUM   | YES       | NULL        | NULL       |
| rg2     | 200        | MEDIUM   | YES       | NULL        | NULL       |
| rg3     | UNLIMITED  | MEDIUM   | YES       | NULL        | NULL       |
| rg4     | UNLIMITED  | MEDIUM   | NO        | NULL        | NULL       |
+---------+------------+----------+-----------+-------------+------------+
5 rows in set (0.01 sec)

mysql> CREATE RESOURCE GROUP IF NOT EXISTS rg5   RU_PER_SEC = 'check'   BURSTABLE=FALSE;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 74 near "BURSTABLE=FALSE"The RU_PER_SEC value 'check' is not valid.

mysql> alter resource group rg1 RU_PER_SEC= unlimited QUERY_LIMIT=(EXEC_ELAPSED='15s' ACTION DRYRUN WATCH SIMILAR DURATION '10m0s')
    -> ;
Query OK, 0 rows affected (0.06 sec)

mysql> SELECT * FROM information_schema.resource_groups;
+---------+------------+----------+-----------+-------------------------------------------------------------------+------------+
| NAME    | RU_PER_SEC | PRIORITY | BURSTABLE | QUERY_LIMIT                                                       | BACKGROUND |
+---------+------------+----------+-----------+-------------------------------------------------------------------+------------+
| default | UNLIMITED  | MEDIUM   | YES       | NULL                                                              | NULL       |
| rg1     | UNLIMITED  | MEDIUM   | YES       | EXEC_ELAPSED='15s', ACTION=DRYRUN, WATCH=SIMILAR DURATION='10m0s' | NULL       |
| rg2     | 200        | MEDIUM   | YES       | NULL                                                              | NULL       |
| rg3     | UNLIMITED  | MEDIUM   | YES       | NULL                                                              | NULL       |
| rg4     | UNLIMITED  | MEDIUM   | NO        | NULL                                                              | NULL       |
+---------+------------+----------+-----------+-------------------------------------------------------------------+------------+
5 rows in set (0.01 sec)

Check List

Tests

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

Release note

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

None

@ti-chi-bot ti-chi-bot Bot added 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. labels Jul 18, 2024
@HuSharp
Copy link
Copy Markdown
Contributor Author

HuSharp commented Jul 18, 2024

@nolouch @JmPotato PTAL, thx!

@tiprow
Copy link
Copy Markdown

tiprow Bot commented Jul 18, 2024

Hi @HuSharp. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Details

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 kubernetes-sigs/prow repository.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.0466%. Comparing base (98b7858) to head (6b15ad8).
Report is 13 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #54704        +/-   ##
================================================
- Coverage   74.7144%   74.0466%   -0.6678%     
================================================
  Files          1558       1561         +3     
  Lines        363836     441747     +77911     
================================================
+ Hits         271838     327099     +55261     
- Misses        72290      94328     +22038     
- Partials      19708      20320       +612     
Flag Coverage Δ
integration 27.9100% <0.0000%> (?)
unit 71.6413% <100.0000%> (-1.9815%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9567% <ø> (-2.2428%) ⬇️
parser ∅ <ø> (∅)
br 51.7713% <ø> (+4.0933%) ⬆️

Comment thread pkg/parser/keywords.go
{"VALIDATION", false, "unreserved"},
{"VALUE", false, "unreserved"},
{"VARIABLES", false, "unreserved"},
{"VECTOR", false, "unreserved"},
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Someone who forgot to update, maybe we need a lint

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added #54827

Comment thread pkg/parser/parser.y Outdated
@nolouch nolouch requested a review from glorv July 19, 2024 06:05
Signed-off-by: husharp <ihusharp@gmail.com>
@HuSharp HuSharp force-pushed the add_ru_unlimited branch from 0bbb09a to abcec2f Compare July 22, 2024 06:31
HuSharp added 2 commits July 22, 2024 14:36
Signed-off-by: husharp <ihusharp@gmail.com>
Signed-off-by: husharp <ihusharp@gmail.com>
@HuSharp HuSharp requested a review from nolouch July 23, 2024 03:21
@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 Jul 24, 2024
@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 Jul 25, 2024
@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 26, 2024
Copy link
Copy Markdown
Contributor

@glorv glorv left a comment

Choose a reason for hiding this comment

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

rest LGTM

Comment thread pkg/parser/ast/ddl.go Outdated
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@ti-chi-bot ti-chi-bot Bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 26, 2024
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Jul 26, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-26 02:22:43.018393195 +0000 UTC m=+1184585.009334657: ☑️ agreed by nolouch.
  • 2024-07-26 06:26:22.471373479 +0000 UTC m=+1199204.462314949: ☑️ agreed by glorv.

Copy link
Copy Markdown
Collaborator

@GMHDBJD GMHDBJD left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Jul 26, 2024

@songrijie: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

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 kubernetes/test-infra repository.

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Jul 26, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: easonn7, glorv, GMHDBJD, nolouch, songrijie, tangenta

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the approved label Jul 26, 2024
@ti-chi-bot ti-chi-bot Bot merged commit 0dff610 into pingcap:master Jul 26, 2024
@HuSharp HuSharp deleted the add_ru_unlimited branch July 26, 2024 09:31
morgo added a commit to morgo/tidb that referenced this pull request Jul 28, 2024
* upstream/master: (93 commits)
  disjoinset: add generic impl (pingcap#54917)
  planner: derive index filters for mv index paths (pingcap#54877)
  br: cli refactor backup error handling logic (pingcap#54697)
  expression: fix infinity loop in `timestampadd` (pingcap#54916)
  planner: import more expand test. (pingcap#54962)
  planner: use code-gen to generate CloneForPlanCache method for some operators (pingcap#54957)
  test: fix flaky test TestFailSchemaSyncer (pingcap#54958)
  planner: move logical show into logicalop pkg. (pingcap#54928)
  privilege: Remove TestAbnormalMySQLTable (pingcap#54925)
  resource_control: support unlimited keyword when setting the resource group (pingcap#54704)
  ddl: fix a data race on localRowCntListener Written() (pingcap#54484)
  lightning: fix SET SESSION on connection pool (pingcap#54927)
  planner: move logical mem-table to logicalop pkg. (pingcap#54903)
  table: Add `CachedTableSupport` and `TemporaryTableSupport` for `MutateContext` (pingcap#54900)
  executor: fix index_hash_join hang when context canceled (pingcap#54855)
  statistics: add metrics for unneeded analyze table (pingcap#54822)
  *: refine pipelined dml benchmarks (pingcap#54844)
  ddl: assign table IDs for jobs submitted to queue (pingcap#54880)
  *: avoid using Tables field of model.DBInfo, use API instead (pingcap#52302)
  planner: remove useless check (pingcap#54907)
  ...
hawkingrei pushed a commit to hawkingrei/tidb that referenced this pull request Aug 1, 2024
budney pushed a commit to budney/tidb that referenced this pull request May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support unlimit keyworld when setting the resource group

7 participants