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

config.tmp-storage-quota didn't work #45161

Closed
guo-shaoge opened this issue Jul 5, 2023 · 0 comments · Fixed by #45549
Closed

config.tmp-storage-quota didn't work #45161

guo-shaoge opened this issue Jul 5, 2023 · 0 comments · Fixed by #45549

Comments

@guo-shaoge
Copy link
Collaborator

guo-shaoge commented Jul 5, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

tmp-storage-quota didn't work at all!!!!

  1. change tidb config, set
    1. tmp-storage-quota = 100
    2. tmp-storage-path = "/tmp/gjt_tidb_tmp_storage"
  2. run following sql: will load 3k.txt
drop table t1, t2;
create table t1(c1 int, c2 int);
create table t2(c1 int, c2 int);
load data local infile '/home/guojiangtao/tmp/3k.txt' into table t1 fields terminated by ' ';
load data local infile '/home/guojiangtao/tmp/3k.txt' into table t2 fields terminated by ' ';
set global tidb_mem_oom_action = 'log';
set @@tidb_mem_quota_query = 100;
explain analyze select count(1) from t1 alias1 inner join t2 alias2;

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

ERROR 1105 (HY000): Out Of Global Storage Quota!

3. What did you see instead (Required)

runs ok, disk usage is 70.3 KB

MySQL [test]> explain analyze select count(1) from t1 alias1 inner join t2 alias2;
+-------------------------------+--------------+---------+-----------+---------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+----------+---------+
| id                            | estRows      | actRows | task      | access object | execution info                                                                                                                                                                                                                                                                                                                                                                               | operator info                  | memory   | disk    |
+-------------------------------+--------------+---------+-----------+---------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+----------+---------+
| HashAgg_8                     | 1.00         | 1       | root      |               | time:6.65s, loops:2, RU:6.857900, partial_worker:{wall_time:6.651762678s, concurrency:5, task_num:8790, tot_wait:32.685925103s, tot_exec:571.040105ms, tot_time:33.258139394s, max:6.651692781s, p95:6.651692781s}, final_worker:{wall_time:6.651800768s, concurrency:5, task_num:5, tot_wait:33.258428098s, tot_exec:20.237µs, tot_time:33.258452092s, max:6.651697321s, p95:6.651697321s}  | funcs:count(1)->Column#7       | 165.3 KB | N/A     |
| └─HashJoin_10                 | 100000000.00 | 9000000 | root      |               | time:6.64s, loops:8791, build_hash_table:{total:6.61ms, fetch:4.22ms, build:2.39ms}, probe:{concurrency:5, total:19.4s, max:6.65s, probe:19.4s, fetch:34ms}                                                                                                                                                                                                                                  | CARTESIAN inner join           | 63.2 KB  | 70.3 KB |
|   ├─TableReader_15(Build)     | 10000.00     | 3000    | root      |               | time:5.58ms, loops:4, cop_task: {num: 5, max: 1.78ms, min: 698.4µs, avg: 1.14ms, p95: 1.78ms, tot_proc: 2ms, rpc_num: 5, rpc_time: 5.49ms, copr_cache_hit_ratio: 0.00, build_task_duration: 7.61µs, max_distsql_concurrency: 1}                                                                                                                                                              | data:TableFullScan_14          | 16.7 KB  | N/A     |
|   │ └─TableFullScan_14        | 10000.00     | 3000    | cop[tikv] | table:alias2  | tikv_task:{proc max:1.67ms, min:543.7µs, avg: 1.03ms, p80:1.67ms, p95:1.67ms, iters:0, tasks:5}                                                                                                                                                                                                                                                                                              | keep order:false, stats:pseudo | N/A      | N/A     |
|   └─TableReader_13(Probe)     | 10000.00     | 3000    | root      |               | time:4.25ms, loops:4, cop_task: {num: 5, max: 1.69ms, min: 675.9µs, avg: 1.15ms, p95: 1.69ms, tot_proc: 2ms, rpc_num: 5, rpc_time: 5.53ms, copr_cache_hit_ratio: 0.00, build_task_duration: 18.9µs, max_distsql_concurrency: 1}                                                                                                                                                              | data:TableFullScan_12          | 16.7 KB  | N/A     |
|     └─TableFullScan_12        | 10000.00     | 3000    | cop[tikv] | table:alias1  | tikv_task:{proc max:1.59ms, min:518.4µs, avg: 1.03ms, p80:1.59ms, p95:1.59ms, iters:0, tasks:5}                                                                                                                                                                                                                                                                                              | keep order:false, stats:pseudo | N/A      | N/A     |
+-------------------------------+--------------+---------+-----------+---------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+----------+---------+
6 rows in set (6.655 sec)

4. What is your TiDB version? (Required)

MySQL [test]> select tidb_version();
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                          |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v7.3.0-alpha-94-gc44ba1c1a8
Edition: Community
Git Commit Hash: c44ba1c1a868220764d9f11274b683d1aaecacb6
Git Branch: master
UTC Build Time: 2023-07-05 03:47:45
GoVersion: go1.20.1
Race Enabled: false
Check Table Before Drop: false
Store: unistore |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.001 sec)
@guo-shaoge guo-shaoge added type/bug The issue is confirmed as a bug. severity/major labels Jul 5, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Jul 5, 2023
@jebter jebter added the sig/execution SIG execution label Jul 27, 2023
@wshwsh12 wshwsh12 self-assigned this Jul 27, 2023
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.

3 participants