tidb从5.3.4升级到 6.1.7时 tidb-server启动报错 (pd和tikv已经升级到6.1.7了)

报错信息
[2025/03/20 21:45:19.695 +08:00] [WARN] [session.go:889] [“can not retry txn”] [label=internal] [error=“[domain:8027]Information schema is out of date: schema failed to update in 1 lease, please make sure TiDB can connect to TiKV”] [IsBatchInsert=false] [IsPessimistic=false] [InRestrictedSQL=true] [tidb_retry_limit=10] [tidb_disable_txn_auto_retry=true]
[2025/03/20 21:45:19.695 +08:00] [WARN] [session.go:905] [“commit failed”] [“finished txn”=“Txn{state=invalid}”] [error=“[domain:8027]Information schema is out of date: schema failed to update in 1 lease, please make sure TiDB can connect to TiKV”]
[2025/03/20 21:45:19.695 +08:00] [WARN] [session.go:1990] [“run statement failed”] [schemaVersion=213236] [error=“[domain:8027]Information schema is out of date: schema failed to update in 1 lease, please make sure TiDB can connect to TiKV”] [session=“{\n "currDBName": "",\n "id": 0,\n "status": 2,\n "strictMode": true,\n "user": null\n}”]
[2025/03/20 21:45:19.695 +08:00] [FATAL] [bootstrap.go:2086] [“mustExecute error”] [error=“[domain:8027]Information schema is out of date: schema failed to update in 1 lease, please make sure TiDB can connect to TiKV”] [stack=“github.com/pingcap/tidb/session.mustExecute\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/bootstrap.go:2086\ngithub.com/pingcap/tidb/session.upgradeToVer80\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/bootstrap.go:1746\ngithub.com/pingcap/tidb/session.upgrade\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/bootstrap.go:787\ngithub.com/pingcap/tidb/session.runInBootstrapSession\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/session.go:2971\ngithub.com/pingcap/tidb/session.BootstrapSession\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/session.go:2857\nmain.createStoreAndDomain\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/tidb-server/main.go:296\nmain.main\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/tidb-server/main.go:202\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250”] [stack=“github.com/pingcap/tidb/session.mustExecute\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/bootstrap.go:2086\ngithub.com/pingcap/tidb/session.upgradeToVer80\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/bootstrap.go:1746\ngithub.com/pingcap/tidb/session.upgrade\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/bootstrap.go:787\ngithub.com/pingcap/tidb/session.runInBootstrapSession\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/session.go:2971\ngithub.com/pingcap/tidb/session.BootstrapSession\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/session.go:2857\nmain.createStoreAndDomain\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/tidb-server/main.go:296\nmain.main\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/tidb-server/main.go:202\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250”]
[2025/03/20 21:45:34.838 +08:00] [INFO] [cpuprofile.go:115] [“parallel cpu profiler started”]

然后tidb-server回退到5.3.4就正常了

INSERT HIGH_PRIORITY IGNORE INTO mysql.GLOBAL_VARIABLES VALUES (‘tidb_analyze_version’, 1);

执行上面这个sql语句的时候失败了。

感觉是个偶然事件,重新升级一下应该能过去的。

保险起见看看tikv上同时期有没有什么其他的问题。

要保持各组件版本一致。处理完异常后,可以参考这里继续升级。
https://docs.pingcap.com/zh/tidb/stable/upgrade-tidb-using-tiup/#41-升级时报错中断处理完报错后如何继续升级