tidb 报错 [ERROR] [terror.go:307] ["encountered error"] [error="write tcp 10.18.13.226:4000->10.18.13.224:28952: write: connection reset by peer"]

【 TiDB 使用环境】测试环境
【 TiDB 版本】5.4.1
【遇到的问题】
tidb 报错 [ERROR] [terror.go:307] [“encountered error”] [error=“write tcp 10.18.13.226:4000->10.18.13.224:28952: write: connection reset by peer”]
【复现路径】做过哪些操作出现的问题
【问题现象及影响】
haproxy配置了ip透传,10.18.13.224为haproxy ip
[2022/10/30 17:53:12.640 +08:00] [ERROR] [terror.go:307] [“encountered error”] [error=“write tcp 10.18.13.226:4000->10.18.13.224:28952: write: connection reset by peer”] [stack=“github.com/pingcap/tidb/parser/terror.Log\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/parser/terror/terror.go:307\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/server.go:516”]
[2022/10/30 17:53:14.643 +08:00] [ERROR] [terror.go:307] [“encountered error”] [error=“write tcp 10.18.13.226:4000->10.18.13.224:28955: write: connection reset by peer”] [stack=“github.com/pingcap/tidb/parser/terror.Log\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/parser/terror/terror.go:307\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/server.go:516”]
[2022/10/30 17:53:16.646 +08:00] [ERROR] [terror.go:307] [“encountered error”] [error=“write tcp 10.18.13.226:4000->10.18.13.224:28959: write: connection reset by peer”] [stack=“github.com/pingcap/tidb/parser/terror.Log\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/parser/terror/terror.go:307\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/server.go:516”]
[2022/10/30 17:53:18.649 +08:00] [ERROR] [terror.go:307] [“encountered error”] [error=“write tcp 10.18.13.226:4000->10.18.13.224:28962: write: connection reset by peer”] [stack=“github.com/pingcap/tidb/parser/terror.Log\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/parser/terror/terror.go:307\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/server.go:516”]
[2022/10/30 17:53:20.651 +08:00] [ERROR] [terror.go:307] [“encountered error”] [error=“write tcp 10.18.13.226:4000->10.18.13.224:28965: write: connection reset by peer”] [stack=“github.com/pingcap/tidb/parser/terror.Log\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/parser/terror/terror.go:307\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/server.go:516”]
[2022/10/30 17:53:22.655 +08:00] [ERROR] [terror.go:307] [“encountered error”] [error=“write tcp 10.18.13.226:4000->10.18.13.224:28967: write: connection reset by peer”] [stack=“github.com/pingcap/tidb/parser/terror.Log\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/parser/terror/terror.go:307\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/server.go:516”]

1 个赞

先上集群配置信息,描述相关节点的状态
然后 write tcp 10.18.13.226:4000->10.18.13.224:28952: write: connection reset by peer 这两个节点是什么关系? 请描述清楚

[问题澄清]

[error] write tcp 10.138.1.98:4000->10.130.64.10:36760: write: connection reset by peer

[原因分析]

说明前台自己断开了连接,TiDB发送的消息没有被接收,TiDB 暂时无超时机制。

[解决方案]

如果 TiDB 日志中很频繁的出现这个信息,可能因为前端有负载均衡在探测后端服务是否存活,属于正常信息,可以改成使用 status 的端口(默认是 10080)

1 个赞

Mark
server web01 172.30.1.106:80 cookie httpd-106 check port 9000 addr 172.30.1.107 inter 3000 fall 3 rise 5

此话题已在最后回复的 60 天后被自动关闭。不再允许新回复。