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

execute sql panic #17419

Open
zhangjinpeng87 opened this issue May 26, 2020 · 9 comments
Open

execute sql panic #17419

zhangjinpeng87 opened this issue May 26, 2020 · 9 comments
Labels
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

@zhangjinpeng87
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

sysbench prepare

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

No panic

3. What did you see instead (Required)

[2020/05/25 18:56:43.567 +08:00] [ERROR] [adapter.go:123] ["execute sql panic"] [conn=5027] [sql="SELECT *, unix_timestamp(Time) as timestamp FROM `INFORMATION_SCHEMA`.`CLUSTER_SLOW_QUERY`  WHERE (time between from_unixtime(?) and from_unixtime(?)) AND (DB IN (?,?)) ORDER BY Time desc LIMIT 100"] [stack="github.com/pingcap/tidb/executor.(*recordSet).Next.func1\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/executor/adapter.go:123\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:679\nruntime.assertE2I\n\t/usr/local/go/src/runtime/iface.go:475\ngithub.com/pingcap/tidb/planner/core.GetStatsInfo\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/planner/core/util.go:220\ngithub.com/pingcap/tidb/util/expensivequery.genLogFields\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/util/expensivequery/expensivequery.go:111\ngithub.com/pingcap/tidb/util/expensivequery.logExpensiveQuery\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/util/expensivequery/expensivequery.go:167\ngithub.com/pingcap/tidb/util/expensivequery.(*Handle).LogOnQueryExceedMemQuota\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/util/expensivequery/expensivequery.go:100\ngithub.com/pingcap/tidb/util/memory.(*LogOnExceed).Action\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/util/memory/action.go:64\ngithub.com/pingcap/tidb/util/memory.(*Tracker).Consume\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/util/memory/tracker.go:226\ngithub.com/pingcap/tidb/util/chunk.(*List).AppendRow\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/util/chunk/list.go:96\ngithub.com/pingcap/tidb/util/chunk.(*RowContainer).AppendRow\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/util/chunk/row_container.go:150\ngithub.com/pingcap/tidb/executor.(*TopNExec).processChildChk\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/executor/sort.go:498\ngithub.com/pingcap/tidb/executor.(*TopNExec).executeTopN\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/executor/sort.go:472\ngithub.com/pingcap/tidb/executor.(*TopNExec).Next\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/executor/sort.go:409\ngithub.com/pingcap/tidb/executor.Next\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/executor/executor.go:268\ngithub.com/pingcap/tidb/executor.(*ProjectionExec).unParallelExecute\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/executor/projection.go:185\ngithub.com/pingcap/tidb/executor.(*ProjectionExec).Next\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/executor/projection.go:171\ngithub.com/pingcap/tidb/executor.Next\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/executor/executor.go:268\ngithub.com/pingcap/tidb/executor.(*recordSet).Next\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/executor/adapter.go:126\ngithub.com/pingcap/tidb/server.(*tidbResultSet).Next\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/server/driver_tidb.go:369\ngithub.com/pingcap/tidb/server.(*clientConn).writeChunks\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/server/conn.go:1440\ngithub.com/pingcap/tidb/server.(*clientConn).writeResultset\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/server/conn.go:1406\ngithub.com/pingcap/tidb/server.(*clientConn).handleStmtExecute\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/server/conn_stmt.go:209\ngithub.com/pingcap/tidb/server.(*clientConn).dispatch\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/server/conn.go:914\ngithub.com/pingcap/tidb/server.(*clientConn).Run\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/server/conn.go:715\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/jenkins/agent/workspace/tidb_master/go/src/github.com/pingcap/tidb/server/server.go:415"]

4. Affected version (Required)

v4.0.0

5. Root Cause Analysis

@SunRunAway
Copy link
Contributor

This issue is resolved by the workaround of #19316 and the panic will no longer happen.

But I'll leave this issue open until it is fully fixed.

@breezewish
Copy link
Member

But I'll leave this issue open until it is fully fixed.

What else should we do to reach "fully fix" state? @SunRunAway

@wjhuang2016
Copy link
Member

@SunRunAway PTAL

@XuHuaiyu XuHuaiyu closed this as completed Dec 3, 2020
@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

@tisonkun
Copy link
Contributor

@SunRunAway @XuHuaiyu is this issue fixed "fully"?

@tisonkun tisonkun reopened this Sep 23, 2021
@tisonkun
Copy link
Contributor

tisonkun commented Sep 23, 2021

@SunRunAway @XuHuaiyu although, we can close this issue as there is a workaround. But could you create a new issue to describe the root cause and we can work on that to entirely fix the issue?

@SunRunAway
Copy link
Contributor

SunRunAway commented Sep 24, 2021

There're two PRs related to this issue.
The panic happened every time when a query is sent by command EXECUTE and in the meantime, the query prints an expensive query log in tidb.

#17874 was the original one, and I tried to fix it, but I was blocked because one of the JDBC tests failed.

#19316 was the workaround one, but the expensive query log will have no plan detail if a query triggers an expensive query log with command EXECUTE.

Because I have no time to fix it properly now, I suggest someone should investigate with #17874 again if we want to fix it entirely.

@SunRunAway SunRunAway removed their assignment Sep 24, 2021
@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-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
Development

Successfully merging a pull request may close this issue.