tidb-server未oom重启问题

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

  • 【TiDB 版本】:3.0.12
  • 【问题描述】:TIDB-SERVERC在多个sql查询大表(4亿左右)时会挂掉并重启,期间未出现oom和io及网络异常。tidb.log无错误日志,tidb_stderr.log日志如下:
    goroutine 1091 [running]:
    github.com/pingcap/tidb/planner/core.GetStatsInfo(0x0, 0x0, 0x9)
    /home/jenkins/agent/workspace/tidb_v3.0.12/go/src/github.com/pingcap/tidb/planner/core/util.go:172 +0x45
    github.com/pingcap/tidb/util/expensivequery.logExpensiveQuery(0xdfae238ea, 0xc005f94b00)
    /home/jenkins/agent/workspace/tidb_v3.0.12/go/src/github.com/pingcap/tidb/util/expensivequery/expensivequery.go:108 +0x35c
    github.com/pingcap/tidb/util/expensivequery.(*Handle).Run(0xc005ada750)
    /home/jenkins/agent/workspace/tidb_v3.0.12/go/src/github.com/pingcap/tidb/util/expensivequery/expensivequery.go:68 +0x156
    created by main.createServer
    /home/jenkins/agent/workspace/tidb_v3.0.12/go/src/github.com/pingcap/tidb/tidb-server/main.go:558 +0x147
    panic: interface conversion: interface is nil, not core.Plan

pd.log无相关错误日志,tikv.log有如下错误日志:
[2020/09/29 08:01:00.613 +08:00] [ERROR] [kv.rs:1046] [“KvService response batch commands fail”]
[2020/09/29 08:01:00.615 +08:00] [ERROR] [kv.rs:1046] [“KvService response batch commands fail”]
[2020/09/29 08:01:00.623 +08:00] [ERROR] [kv.rs:1046] [“KvService response batch commands fail”]
[2020/09/29 08:01:00.623 +08:00] [ERROR] [kv.rs:1046] [“KvService response batch commands fail”]

目前是将该表数据删除一部分后,临时时解决了问题。烦请官方小伙伴帮忙定位下是不是tidb-server为什么会挂掉?

看下操作系统的 message 日志是否有报错

谢谢回复,当时的message信息如下:

Sep 29 08:00:50 SZE-BPL0001507 systemd: Starting Session 700929 of user cfop.
Sep 29 08:00:52 SZE-BPL0001507 systemd-logind: Removed session 700929.
Sep 29 08:01:00 SZE-BPL0001507 systemd: tidb-4000.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Sep 29 08:01:00 SZE-BPL0001507 systemd: Unit tidb-4000.service entered failed state.
Sep 29 08:01:00 SZE-BPL0001507 systemd: tidb-4000.service failed.
Sep 29 08:01:01 SZE-BPL0001507 systemd: Started Session 700930 of user root.
Sep 29 08:01:01 SZE-BPL0001507 systemd: Starting Session 700930 of user root.
Sep 29 08:01:15 SZE-BPL0001507 systemd: tidb-4000.service holdoff time over, scheduling restart.
Sep 29 08:01:15 SZE-BPL0001507 systemd: Started tidb-4000 service.
Sep 29 08:01:15 SZE-BPL0001507 systemd: Starting tidb-4000 service…
Sep 29 08:01:41 SZE-BPL0001507 systemd-logind: New session 700931 of user cfop.

你好,有排查到原因吗?

以前有类似问题,systemd[1]: tidb-4000.service: main process exited, code=exited, status=2/INVALIDARGUMENT 建议升级处理,你这个版本应该没有这个问题。 可以看下监控,cpu,内存 和 IO 是否当时有问题,如果都正常,可以找你们操作系统维护人员帮忙分析下,这个报错是操作系统抛出的异常

我看了,问题类似,说在3.0.6已经解决,我是3.0.12版本但问题还是复现了,暂时集群还无法升级,请问这具体是什么问题引起的,怎样避免?

cup io 内存 等均正常

为什么是执行sql时会触发系统问题?

刚才看4.0的版本也有该问题:tidb 连接自动断开

执行sql会占用系统内存或者其他资源,调用操作系统函数等,这个报错是操作系统级别的报错,看起可能是某些操作系统的参数设置有影响。可以搜索下 INVALIDARGUMENT 会看到一些介绍,但是没有找到明确的解决方法

好的,我们在排查下,非常感谢支持。

:handshake: