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

SQL hang for analyze table when exceed tidb_mem_quota_analyze #48356

Closed
wshwsh12 opened this issue Nov 7, 2023 · 0 comments · Fixed by #48365
Closed

SQL hang for analyze table when exceed tidb_mem_quota_analyze #48356

wshwsh12 opened this issue Nov 7, 2023 · 0 comments · Fixed by #48365

Comments

@wshwsh12
Copy link
Contributor

wshwsh12 commented Nov 7, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use test;
use the file tests/integrationtest/t/executor/analyze.test L3-L796 to load data.
set global tidb_mem_quota_analyze=128;
analyze table t1;
analyze table t1;
analyze table t1;
analyze table t1;
analyze table t1;
analyze table t1;

goroutine 25704 [chan send, 9 minutes]:
github.com/pingcap/tidb/pkg/executor.(*AnalyzeExec).Next(0xc00453bbc0, {0x62ed1b0?, 0xc006ee0720}, 0x1?)
	/home/wshwsh12/project/tidb/pkg/executor/analyze.go:139 +0x545
github.com/pingcap/tidb/pkg/executor/internal/exec.Next({0x62ed1b0, 0xc006ee0720}, {0x63044c8, 0xc00453bbc0}, 0xc0056f7450)
	/home/wshwsh12/project/tidb/pkg/executor/internal/exec/executor.go:278 +0x2ba
github.com/pingcap/tidb/pkg/executor.(*ExecStmt).next(0xc0041def00, {0x62ed1b0, 0xc006ee0720}, {0x63044c8, 0xc00453bbc0}, 0x3c80a0?)
	/home/wshwsh12/project/tidb/pkg/executor/adapter.go:1226 +0x6e
github.com/pingcap/tidb/pkg/executor.(*ExecStmt).handleNoDelayExecutor(0xc0041def00, {0x62ed1b0?, 0xc006ee0720?}, {0x63044c8?, 0xc00453bbc0})
	/home/wshwsh12/project/tidb/pkg/executor/adapter.go:971 +0x396
github.com/pingcap/tidb/pkg/executor.(*ExecStmt).handleNoDelay(0xc0041def00, {0x62ed1b0, 0xc006ee0720}, {0x63044c8?, 0xc00453bbc0?}, 0x0)
	/home/wshwsh12/project/tidb/pkg/executor/adapter.go:797 +0x252
github.com/pingcap/tidb/pkg/executor.(*ExecStmt).Exec(0xc0041def00, {0x62ed1b0, 0xc006ee0720})
	/home/wshwsh12/project/tidb/pkg/executor/adapter.go:578 +0xda5
github.com/pingcap/tidb/pkg/session.runStmt({0x62ed1b0?, 0xc00a807560?}, 0xc00256bb80, {0x62fcc60, 0xc0041def00?})
	/home/wshwsh12/project/tidb/pkg/session/session.go:2421 +0x422
github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt(0xc00256bb80, {0x62ed1b0?, 0xc00a807560?}, {0x6302aa8?, 0xc00598a0d0?})
	/home/wshwsh12/project/tidb/pkg/session/session.go:2271 +0x109b
github.com/pingcap/tidb/pkg/server.(*TiDBContext).ExecuteStmt(0xc007db9b90, {0x62ed1b0, 0xc00a807560}, {0x6302aa8?, 0xc00598a0d0})
	/home/wshwsh12/project/tidb/pkg/server/driver_tidb.go:292 +0xa7
github.com/pingcap/tidb/pkg/server.(*clientConn).handleStmt(0xc0041f6c00, {0x62ed1e8, 0xc005986050}, {0x6302aa8, 0xc00598a0d0}, {0x0, 0x0, 0x0}, 0x1)
	/home/wshwsh12/project/tidb/pkg/server/conn.go:2009 +0x153
github.com/pingcap/tidb/pkg/server.(*clientConn).handleQuery(0xc0041f6c00, {0x62ed1e8, 0xc005986050}, {0xc00b48daa1, 0x10})
	/home/wshwsh12/project/tidb/pkg/server/conn.go:1800 +0x9a5
github.com/pingcap/tidb/pkg/server.(*clientConn).dispatch(0xc0041f6c00, {0x62ed1b0?, 0xc00aaabbc0?}, {0xc00b48daa0, 0x11, 0x11})
	/home/wshwsh12/project/tidb/pkg/server/conn.go:1287 +0xf8b
github.com/pingcap/tidb/pkg/server.(*clientConn).Run(0xc0041f6c00, {0x62ed1b0, 0xc00aaabbc0})
	/home/wshwsh12/project/tidb/pkg/server/conn.go:1066 +0x53e
github.com/pingcap/tidb/pkg/server.(*Server).onConn(0xc0029ce800?, 0xc0041f6c00)
	/home/wshwsh12/project/tidb/pkg/server/server.go:701 +0x89d
created by github.com/pingcap/tidb/pkg/server.(*Server).startNetworkListener in goroutine 16969
	/home/wshwsh12/project/tidb/pkg/server/server.go:517 +0x77f

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

Can cancel the sql or run successfully.

3. What did you see instead (Required)

Hang.

4. What is your TiDB version? (Required)

master-6020ede217

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