为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
- 【TiDB 版本】:V4.0
- 【问题描述】:
max_prepared_stmt_count 该参数默认值16382,
无法像mysql一样根据status查询开启和关闭数 show global status like ‘com_stmt%’;
如何判断tidb prepared_stmt的值过高. 可以确定当时并发的prepared_stmt并没有默认值那么高
使用dumpling根据语句导入csv文件报错如下:
Release version: v4.0.2
Git commit hash: ff92fcf2fa8fc77127df21820280f6b2088b8309
Git branch: heads/v4.0.2
Build timestamp: 2020-07-01 09:42:00Z
Go version: go version go1.13 linux/amd64
[2020/10/19 00:11:46.395 +08:00] [INFO] [config.go:139] [“detect server type”] [type=TiDB]
[2020/10/19 00:11:46.395 +08:00] [INFO] [config.go:157] [“detect server version”] [version=4.0.0]
[2020/10/19 00:11:46.422 +08:00] [INFO] [client.go:147] ["[pd] create pd client with endpoints"] [pd-address="[10.58.0.158:2379,10.58.0.156:2379,10.58.0.157:2379]"]
[2020/10/19 00:11:46.435 +08:00] [INFO] [base_client.go:226] ["[pd] update member urls"] [old-urls="[http://10.58.0.158:2379,http://10.58.0.156:2379,http://10.58.0.157:2379]"] [new-urls="[http://10.58.0.156:2379,http://10.58.0.157:2379,http://10.58.0.158:2379]"]
[2020/10/19 00:11:46.435 +08:00] [INFO] [base_client.go:242] ["[pd] switch leader"] [new-leader=http://10.58.0.157:2379] [old-leader=]
[2020/10/19 00:11:46.435 +08:00] [INFO] [base_client.go:92] ["[pd] init cluster id"] [cluster-id=6670426230930953105]
[2020/10/19 00:11:46.438 +08:00] [ERROR] [main.go:191] [“dump failed error stack info”] [error=“Error 1461: Can’t create more than maxPreparedStmtCount statements (current value: 16382)”] [errorVerbose=“err = Error 1461: Can’t create more than maxPreparedStmtCount statements (current value: 16382)\
goroutine 1[running]:\
runtime/debug.Stack(0xdfbd00, 0xc00016c140, 0xdfd0e0)\
\t/usr/local/go/src/runtime/debug/stack.go:24 +0x9d\ngithub.com/pingcap/dumpling/v4/export.withStack(0xdfbd00, 0xc00016c140, 0xc000038000, 0xc0003e2150)\
\t/home/jenkins/agent/workspace/build-linux-amd64-4.0/go/src/github.com/pingcap/dumpling/v4/export/error.go:59 +0x8d\ngithub.com/pingcap/dumpling/v4/export.resetDBWithSessionParams(0xc0001fc000, 0xc00046a140, 0x41, 0xc0001c5650, 0x41, 0xc0003ea6f0, 0x12c)\
\t/home/jenkins/agent/workspace/build-linux-amd64-4.0/go/src/github.com/pingcap/dumpling/v4/export/sql.go:422 +0x62b\ngithub.com/pingcap/dumpling/v4/export.Dump(0xe12a60, 0xc000038098, 0xc0000fdd40, 0x0, 0x0)\
\t/home/jenkins/agent/workspace/build-linux-amd64-4.0/go/src/github.com/pingcap/dumpling/v4/export/dump.go:101 +0x327\
main.main()\
\t/home/jenkins/agent/workspace/build-linux-amd64-4.0/go/src/github.com/pingcap/dumpling/cmd/dumpling/main.go:189 +0x1318\
”] [stack=“github.com/pingcap/log.Error\
\t/go/pkg/mod/github.com/pingcap/log@v0.0.0-20200511115504-543df19646ad/global.go:42\
main.main\
\t/home/jenkins/agent/workspace/build-linux-amd64-4.0/go/src/github.com/pingcap/dumpling/cmd/dumpling/main.go:191\
runtime.main\
\t/usr/local/go/src/runtime/proc.go:203”]
dump failed: Error 1461: Can’t create more than maxPreparedStmtCount statements (current value: 16382)