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

CTE statement left spilled files unremoved #44477

Closed
yibin87 opened this issue Jun 7, 2023 · 2 comments · Fixed by #44501
Closed

CTE statement left spilled files unremoved #44477

yibin87 opened this issue Jun 7, 2023 · 2 comments · Fixed by #44501
Labels
affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.1 affects-6.5 affects-7.1 severity/critical sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@yibin87
Copy link
Contributor

yibin87 commented Jun 7, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!
CTE statment executed successfully, while left spilled files unremoved.

Beq4amDf33
The CTEFullScan_68 occupied 2.6GB disk size, and not released finally.

4. What is your TiDB version? (Required)

v6.1.x

@yibin87 yibin87 added the type/bug The issue is confirmed as a bug. label Jun 7, 2023
@guo-shaoge
Copy link
Collaborator

guo-shaoge commented Jun 7, 2023

Reproduce steps:

  1. start tidb-server
  2. run following sqls:
drop table t1, t2;
create table t1(c1 int, c2 int);
create table t2(c1 int);
set @@cte_max_recursion_depth = 1000000;
set global tidb_mem_oom_action = 'log';
set @@tidb_mem_quota_query = 100;
select @@tidb_mem_oom_action; # make sure tidb_mem_oom_action is log
insert into t2 values(1);
insert into t1 (c1, c2) with recursive cte1 as (select c1 from t2 union select cte1.c1 + 1 from cte1 where cte1.c1 < 1000000) select cte1.c1, cte1.c1+1 from cte1;
  1. check /tmp/1000_tidb/xxx/xxx, you can see remaining chunk list file even when sql finish

@guo-shaoge guo-shaoge added the sig/execution SIG execution label Jun 7, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.1 This bug maybe affects 5.1.x versions. 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-7.1 labels Jun 7, 2023
@guo-shaoge
Copy link
Collaborator

select stmt is ok, Ohter DML has this problem.

@guo-shaoge guo-shaoge added affects-5.4 This bug affects 5.4.x versions. and removed may-affects-5.1 This bug maybe affects 5.1.x versions. 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. labels Jun 8, 2023
ti-chi-bot bot pushed a commit that referenced this issue Jun 8, 2023
@ti-chi-bot ti-chi-bot added the affects-5.3 This bug affects 5.3.x versions. label Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.1 affects-6.5 affects-7.1 severity/critical sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants