TiDB CommitWork panicked

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

  • 【TiDB 版本】:4.0.8
  • 【问题描述】:

[2021/06/30 14:53:12.802 +00:00] [INFO] [load_data.go:426] [“batch limit hit when inserting rows”] [conn=266727] [maxBatchRows=1024] [totalRows=40000]
[2021/06/30 14:53:12.896 +00:00] [ERROR] [load_data.go:225] [“CommitWork panicked”] [conn=266727] [r={}] [stack=“github.com/pingcap/tidb/executor.(*LoadDataInfo).CommitWork.func1\n\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/executor/load_data.go:227\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:679\nruntime.goPanicIndex\n\t/usr/local/go/src/runtime/panic.go:75\ngithub.com/pingcap/tidb/executor.getKeysNeedCheckOneRow\n\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/executor/batch_checker.go:107\ngithub.com/pingcap/tidb/executor.getKeysNeedCheck\n\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/executor/batch_checker.go:86\ngithub.com/pingcap/tidb/executor.(*InsertValues).batchCheckAndInsert\n\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/executor/insert_common.go:968\ngithub.com/pingcap/tidb/executor.(*LoadDataInfo).CheckAndInsertOneBatch\n\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/executor/load_data.go:441\ngithub.com/pingcap/tidb/executor.(*LoadDataInfo).CommitOneTask\n\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/executor/load_data.go:199\ngithub.com/pingcap/tidb/executor.(*LoadDataInfo).CommitWork\n\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/executor/load_data.go:247\ngithub.com/pingcap/tidb/server.(*clientConn).handleLoadData\n\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/server/conn.go:1253\ngithub.com/pingcap/tidb/server.(*clientConn).handleQuery\n\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/server/conn.go:1376\ngithub.com/pingcap/tidb/server.(*clientConn).dispatch\n\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/server/conn.go:985\ngithub.com/pingcap/tidb/server.(*clientConn).Run\n\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/server/conn.go:772\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/jenkins/agent/workspace/tidb_v4.0.8/go/src/github.com/pingcap/tidb/server/server.go:421”]
[2021/06/30 14:53:12.932 +00:00] [ERROR] [conn.go:1215] [“load data process stream error”] [conn=266727] [error=“processStream forced to quit”]
[2021/06/30 14:53:12.932 +00:00] [WARN] [conn.go:759] [“read packet failed, close this connection”] [conn=266727] [error="[server:8052]invalid sequence 17 != 0"]

这个问题是什么原因导致的?

提问前建议搜索下,看起来是这个问题 LOAD DATA LOCAL INFILE 文件入库时panic

set @@tidb_dml_batch_size = xxxx
这个是session级别的变量,有全局的控制变量吗?

:pleading_face: 4.0.8 没有,这个参数在 5.0 作用域才从 session 改编为 global 的

已经修复了,可以升级到 4.0.13 https://github.com/pingcap/tidb/pull/22724