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

tidb panic with “err="runtime error: index out of range [17] with length 17"” when add and drop column #54254

Closed
Lily2025 opened this issue Jun 27, 2024 · 6 comments · Fixed by #54301
Assignees
Labels
affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.2 affects-8.5 This bug affects the 8.5.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. impact/panic severity/major type/bug The issue is confirmed as a bug.

Comments

@Lily2025
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

1、run tpcc
2、add and drop column

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

no panic

3. What did you see instead (Required)

tidb panic
[2024/06/26 16:50:08.323 +08:00] [ERROR] [conn.go:1024] ["connection running loop panic"] [conn=419434458] [session_alias=] [lastSQL="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (42, 9, 0, 24789, 2738)]"] [err="runtime error: index out of range [17] with length 17"] [stack="github.com/pingcap/tidb/pkg/server.(*clientConn).Run.func1\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/server/conn.go:1027\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:914\ngithub.com/pingcap/tidb/pkg/executor.(*Compiler).Compile.func1\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/executor/compiler.go:57\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:914\nruntime.goPanicIndex\n\t/usr/local/go/src/runtime/panic.go:114\ngithub.com/pingcap/tidb/pkg/planner/core.GetUpdateColumnsInfo\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/core/logical_plan_builder.go:5849\ngithub.com/pingcap/tidb/pkg/planner/core.(*Update).buildTbl2UpdateColumns\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/core/foreign_key.go:336\ngithub.com/pingcap/tidb/pkg/planner/core.(*Update).buildOnUpdateFKTriggers\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/core/foreign_key.go:224\ngithub.com/pingcap/tidb/pkg/planner/core.buildPointUpdatePlan\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/core/point_get_plan.go:1970\ngithub.com/pingcap/tidb/pkg/planner/core.tryUpdatePointPlan\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/core/point_get_plan.go:1910\ngithub.com/pingcap/tidb/pkg/planner/core.TryFastPlan\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/core/point_get_plan.go:923\ngithub.com/pingcap/tidb/pkg/planner.Optimize\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/optimize.go:224\ngithub.com/pingcap/tidb/pkg/planner/core.generateNewPlan\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/core/plan_cache.go:297\ngithub.com/pingcap/tidb/pkg/planner/core.GetPlanFromPlanCache\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/core/plan_cache.go:246\ngithub.com/pingcap/tidb/pkg/planner.OptimizeExecStmt\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/optimize.go:541\ngithub.com/pingcap/tidb/pkg/planner.Optimize\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/optimize.go:163\ngithub.com/pingcap/tidb/pkg/executor.(*Compiler).Compile\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/executor/compiler.go:99\ngithub.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/session/session.go:2098\ngithub.com/pingcap/tidb/pkg/server.(*TiDBContext).ExecuteStmt\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/server/driver_tidb.go:294\ngithub.com/pingcap/tidb/pkg/server.(*clientConn).executePreparedStmtAndWriteResult\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/server/conn_stmt.go:306\ngithub.com/pingcap/tidb/pkg/server.(*clientConn).executePlanCacheStmt\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/server/conn_stmt.go:234\ngithub.com/pingcap/tidb/pkg/server.(*clientConn).handleStmtExecute\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/server/conn_stmt.go:225\ngithub.com/pingcap/tidb/pkg/server.(*clientConn).dispatch\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/server/conn.go:1386\ngithub.com/pingcap/tidb/pkg/server.(*clientConn).Run\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/server/conn.go:1125\ngithub.com/pingcap/tidb/pkg/server.(*Server).onConn\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/server/server.go:739"]

4. What is your TiDB version? (Required)

./tidb-server -V
Release Version: v8.2.0-alpha
Edition: Community
Git Commit Hash: 4869956
Git Branch: heads/refs/tags/v8.2.0-alpha
UTC Build Time: 2024-06-25 11:46:19
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: unistore
2024-06-26T16:22:33.898+0800

@Lily2025 Lily2025 added the type/bug The issue is confirmed as a bug. label Jun 27, 2024
@Lily2025
Copy link
Author

/severity major

@Lily2025
Copy link
Author

/assign crazycs520

@crazycs520
Copy link
Contributor

crazycs520 commented Jun 27, 2024

According to the phenomenon, I feel that issue is the same as #48457, and another related issue is maybe #41622.

I've written some tests to try to reproduce, but none of them have been able to reproduce, I checked the relevant code and didn't understand why this happened.

@crazycs520
Copy link
Contributor

#54255 already fixed this issue.

@crazycs520 crazycs520 added component/ddl This issue is related to DDL of TiDB. and removed sig/transaction SIG:Transaction labels Oct 29, 2024
@ti-chi-bot ti-chi-bot bot added the affects-8.5 This bug affects the 8.5.x(LTS) versions. label Nov 1, 2024
@lance6716
Copy link
Contributor

@crazycs520 Can we close this issue?

@crazycs520
Copy link
Contributor

This issue root cause is same with #53634

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.2 affects-8.5 This bug affects the 8.5.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. impact/panic severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants