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

The query may be blocking after identifying a runaway query with a cooldown action. #56916

Closed
nolouch opened this issue Oct 28, 2024 · 0 comments · Fixed by #56920
Closed

The query may be blocking after identifying a runaway query with a cooldown action. #56916

nolouch opened this issue Oct 28, 2024 · 0 comments · Fixed by #56920

Comments

@nolouch
Copy link
Member

nolouch commented Oct 28, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

prepare data

use test;
create table t (id int auto_increment, k int,c varchar(255),  unique index(id));
insert into t (k,c) values (1,'abcqwer');
insert into t (k,c) select k,c from t;
insert into t (k,c) select k,c from t;
insert into t (k,c) select k,c from t;
insert into t (k,c) select k,c from t;
insert into t (k,c) select k,c from t;
insert into t (k,c) select k,c from t;;
insert into t (k,c) select k,c from t;
insert into t (k,c) select k,c from t;
insert into t (k,c) select k,c from t;
insert into t (k,c) select k,c from t;
insert into t (k,c) select k,c from t;
insert into t (k,c) select k,c from t;
insert into t (k,c) select k,c from t;
insert into t (k,c) select k,c from t;
insert into t (k,c) select k,c from t;
insert into t (k,c) select k,c from t;
split table t between (0) and (135536) regions 100;

create table t2 (id int auto_increment, k int,c varchar(255),  unique index(id));
insert into t2 (k,c) values (1,'abcqwer');
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
insert into t2 (k,c) select k,c from t2;
split table t2 between (0) and (135536) regions 100;

add resource group

create user IF NOT EXISTS rg1;
GRANT ALL PRIVILEGES ON *.* TO rg1;
CREATE RESOURCE GROUP IF NOT EXISTS rg1 RU_PER_SEC = 1000 QUERY_LIMIT=(EXEC_ELAPSED '1ms' ACTION  COOLDOWN WATCH = PLAN);
ALTER USER rg1 RESOURCE GROUP rg1;

run twice SQL with user rg1:

SELECT * FROM t use index(id),t2  use index(id) WHERE t.id IN (2341, 4165, 9296, 11817, 12777, 16624, 17053, 17774, 18116, 18676, 19961, 21765, 21802, 23445, 23505, 24263, 24390, 24875, 25957, 27511, 29661, 29857, 30594, 35296, 37182, 38732, 41018, 43542, 44735, 49167, 50970, 51187, 52959, 54317, 54875, 58803, 58826, 62412, 62533, 63510, 64303, 65832, 66437, 66454, 66855, 68154, 68672, 69308, 70891, 76299, 77548, 79204, 80046, 84291, 84348, 84547, 86196, 86812, 89537, 89570, 91826, 94030, 94906, 96240, 96642, 97319, 98775, 99893, 100022, 101823, 101931, 103945, 104560, 104954, 107281, 109624, 110020, 111812, 112112, 113417, 113485, 113711, 113931, 114348, 114885, 116465, 117571, 118674, 121347, 122221, 122716, 122965, 126227, 127175, 127815, 128580, 129646, 130410, 132717, 133089) or  t2.id between 1 and  10 or t2.id between 124660 and 132790;

2. What did you expect to see? (Required)

SQL can run

3. What did you see instead (Required)

SQL blocking forever

4. What is your TiDB version? (Required)

8.4

@nolouch nolouch added type/bug The issue is confirmed as a bug. affects-8.4 severity/critical labels Oct 28, 2024
@nolouch nolouch changed the title query may block after identified runaway query with cooldown action The query may block after identifying a runaway query with a cooldown action. Oct 28, 2024
@nolouch nolouch changed the title The query may block after identifying a runaway query with a cooldown action. The query may blocking after identifying a runaway query with a cooldown action. Oct 28, 2024
@nolouch nolouch changed the title The query may blocking after identifying a runaway query with a cooldown action. The query may be blocking after identifying a runaway query with a cooldown action. Oct 28, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in 11f86a8 Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants