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

Tmp-storage-quota can't take affect #26806

Closed
wshwsh12 opened this issue Aug 3, 2021 · 2 comments · Fixed by #45549
Closed

Tmp-storage-quota can't take affect #26806

wshwsh12 opened this issue Aug 3, 2021 · 2 comments · Fixed by #45549
Assignees
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.0 affects-6.1 This bug affects the 6.1.x(LTS) versions. severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@wshwsh12
Copy link
Contributor

wshwsh12 commented Aug 3, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Set tmp-storage-quota = 100 << 20 (100MB) in config.
Start the cluster and run the following SQLs:

set tidb_mem_quota_query = 300 << 20;

use test;
drop table t;

create table t(a int);
insert into t values(1);
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;

desc analyze select * from t t1 join t t2 join t t3 order by t1.a;

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

Sql should be canceled, because tmp-storage-quota is not enough.

3. What did you see instead (Required)

desc analyze select * from t t1 join t t2 join t t3 order by t1.a;
+---------------------------------+-------------+----------+-----------+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+-----------+----------+
| id                              | estRows     | actRows  | task      | access object | execution info                                                                                                                                                      | operator info                  | memory    | disk     |
+---------------------------------+-------------+----------+-----------+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+-----------+----------+
| Sort_10                         | 16777216.00 | 16777216 | root      |               | time:44.4s, loops:16385                                                                                                                                             | test.t.a                       | 300.0 MB  | 506.1 MB |
| └─HashJoin_13                   | 16777216.00 | 16777216 | root      |               | time:1.15s, loops:16385, build_hash_table:{total:416.9µs, fetch:384.4µs, build:32.6µs}, probe:{concurrency:5, total:15.7s, max:3.16s, probe:15.7s, fetch:4.72ms}    | CARTESIAN inner join           | 8.23 KB   | 0 Bytes  |
|   ├─TableReader_22(Build)       | 256.00      | 256      | root      |               | time:268.6µs, loops:2, cop_task: {num: 1, max: 276.8µs, proc_keys: 0, rpc_num: 1, rpc_time: 236.2µs, copr_cache_hit_ratio: 0.00}                                    | data:TableFullScan_21          | 692 Bytes | N/A      |
|   │ └─TableFullScan_21          | 256.00      | 256      | cop[tikv] | table:t3      | tikv_task:{time:65.5µs, loops:256}                                                                                                                                  | keep order:false, stats:pseudo | N/A       | N/A      |
|   └─HashJoin_15(Probe)          | 65536.00    | 65536    | root      |               | time:1.44ms, loops:65, build_hash_table:{total:231.9µs, fetch:199.7µs, build:32.2µs}, probe:{concurrency:5, total:3.11s, max:3.1s, probe:3.1s, fetch:1.2ms}         | CARTESIAN inner join           | 8.23 KB   | 0 Bytes  |
|     ├─TableReader_20(Build)     | 256.00      | 256      | root      |               | time:64.7µs, loops:2, cop_task: {num: 1, max: 222.6µs, proc_keys: 0, rpc_num: 1, rpc_time: 202.8µs, copr_cache_hit_ratio: 0.00}                                     | data:TableFullScan_19          | 692 Bytes | N/A      |
|     │ └─TableFullScan_19        | 256.00      | 256      | cop[tikv] | table:t2      | tikv_task:{time:49.3µs, loops:256}                                                                                                                                  | keep order:false, stats:pseudo | N/A       | N/A      |
|     └─TableReader_18(Probe)     | 256.00      | 256      | root      |               | time:93.8µs, loops:2, cop_task: {num: 1, max: 231.3µs, proc_keys: 0, rpc_num: 1, rpc_time: 210.2µs, copr_cache_hit_ratio: 0.00}                                     | data:TableFullScan_17          | 692 Bytes | N/A      |
|       └─TableFullScan_17        | 256.00      | 256      | cop[tikv] | table:t1      | tikv_task:{time:47.9µs, loops:256}                                                                                                                                  | keep order:false, stats:pseudo | N/A       | N/A      |
+---------------------------------+-------------+----------+-----------+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+-----------+----------+
9 rows in set (44.454 sec)

4. What is your TiDB version? (Required)

v4.0,v5.0,v5.1,master

@wshwsh12 wshwsh12 added the type/bug The issue is confirmed as a bug. label Aug 3, 2021
@UBarney
Copy link
Contributor

UBarney commented Aug 29, 2021

/assign

@Yisaer Yisaer added affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. labels Dec 3, 2021
@jebter jebter added the affects-5.4 This bug affects the 5.4.x(LTS) versions. label Apr 11, 2022
@VelocityLight VelocityLight added the affects-6.1 This bug affects the 6.1.x(LTS) versions. label May 20, 2022
@zanmato1984
Copy link
Contributor

Adjusting severity to moderate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.0 affects-6.1 This bug affects the 6.1.x(LTS) versions. severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
7 participants