登录数据库时,出现报错9006 GC life time is shorter than transaction duration

【 TiDB 使用环境】测试
【 TiDB 版本】
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
个人电脑通过客户端,登录数据库时,直接报错 9006

➜  ~ mycli stage
(9006, 'GC life time is shorter than transaction duration, transaction starts at 2024-06-05 03:50:55.675 +0800 CST, GC safe point is 2024-07-02 14:03:37.956 +0800 CST')
➜  ~

之后再登录不出现问题

TiDB 5.7.25
mycli 1.26.1
Home: http://mycli.net
Bug tracker: https://github.com/dbcli/mycli/issues
Thanks to the contributor - bitkeen
stage TiDB root@10.25.6.52:test>select * from mysql.tidb;
1 个赞

前排围观,听说这事儿升级可以解决,关于gc的资料大全在这里

3 个赞

:yum:换个客户端试试呢,也可能是客户端导致的。

刚客户端登录后的所有操作都抓出来了,感觉不应该报9006这个错呀

# User@Host: root[root] @ 10.0.2.11:51966 []
# Query_time: 0.000694
USE `test`;
select connection_id();
# Time: 070224 15:12:09.347935
# User@Host: root[root] @ 10.0.2.11:51967 []
# Query_time: 0.000578
USE `test`;
select connection_id();
# Time: 070224 15:12:09.371941
# User@Host: root[root] @ 10.0.2.11:51967 []
# Query_time: 0.000500
SHOW DATABASES;
# Time: 070224 15:12:09.402974
# User@Host: root[root] @ 10.0.2.11:51967 []
# Query_time: 0.001507
SHOW TABLES;
# Time: 070224 15:12:09.412993
# User@Host: root[root] @ 10.0.2.11:51967 []
# Query_time: 0.059761
select TABLE_NAME, COLUMN_NAME from information_schema.columns
                                    where table_schema = 'test'
                                    order by table_name,ordinal_position;
# Time: 070224 15:12:09.482014
# User@Host: root[root] @ 10.0.2.11:51967 []
# Query_time: 0.006734
SELECT CONCAT("'", user, "'@'",host,"'") FROM mysql.user;
# Time: 070224 15:12:09.497987
# User@Host: root[root] @ 10.0.2.11:51967 []
# Query_time: 0.001467
SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES
    WHERE ROUTINE_TYPE="FUNCTION" AND ROUTINE_SCHEMA = "test";
# Time: 070224 15:12:09.507591
# User@Host: root[root] @ 10.0.2.11:51967 []
# Query_time: 0.003969
SELECT name from mysql.help_topic WHERE name like "SHOW %";

是首次连接报错时候的操作么? :thinking:

tidb服务日志有这个报错吗?

1 个赞
  1. tidb log
[2024/07/02 15:39:51.198 +08:00] [WARN] [session.go:2036] ["failed to load global variables"] [conn=82340372] [error="[tikv:9006]GC life time is shorter than transaction duration, transaction starts at 2024-06-16 02:24:18.606 +0800 CST, GC safe point is 2024-07-02 15:24:37.956 +0800 CST"]
[2024/07/02 15:39:51.198 +08:00] [WARN] [conn.go:630] ["open new session failure"] [conn=82340372] [error="[tikv:9006]GC life time is shorter than transaction duration, transaction starts at 2024-06-16 02:24:18.606 +0800 CST, GC safe point is 2024-07-02 15:24:37.956 +0800 CST"]
[2024/07/02 15:39:51.248 +08:00] [WARN] [session.go:2036] ["failed to load global variables"] [conn=82340373] [error="[tikv:9006]GC life time is shorter than transaction duration, transaction starts at 2024-06-16 02:24:03.106 +0800 CST, GC safe point is 2024-07-02 15:24:37.956 +0800 CST"]
[2024/07/02 15:39:51.248 +08:00] [WARN] [conn.go:630] ["open new session failure"] [conn=82340373] [error="[tikv:9006]GC life time is shorter than transaction duration, transaction starts at 2024-06-16 02:24:03.106 +0800 CST, GC safe point is 2024-07-02 15:24:37.956 +0800 CST"]
[2024/07/02 15:39:52.182 +08:00] [ERROR] [domain.go:931] ["update bindinfo failed"] [error="[tikv:9006]GC life time is shorter than transaction duration, transaction starts at 2024-06-16 02:23:47.606 +0800 CST, GC safe point is 2024-07-02 15:24:37.956 +0800 CST"]
[2024/07/02 15:39:55.182 +08:00] [ERROR] [domain.go:931] ["update bindinfo failed"] [error="[tikv:9006]GC life time is shorter than transaction duration, transaction starts at 2024-06-16 02:23:16.606 +0800 CST, GC safe point is 2024-07-02 15:24:37.956 +0800 CST"]
[2024/07/02 15:40:01.181 +08:00] [ERROR] [domain.go:931] ["update bindinfo failed"] [error="[tikv:9006]GC life time is shorter than transaction duration, transaction starts at 2024-06-16 02:24:34.106 +0800 CST, GC safe point is 2024-07-02 15:24:37.956 +0800 CST"]
[2024/07/02 15:40:04.186 +08:00] [ERROR] [domain.go:931] ["update bindinfo failed"] [error="[tikv:9006]GC life time is shorter than transaction duration, transaction starts at 2024-06-16 02:24:49.556 +0800 CST, GC safe point is 2024-07-02 15:24:37.956 +0800 CST"]

  1. looks like this bug

Issues · pingcap/tidb · GitHub

但是这个issue对bug影响的版本和修复版本的描述并不太清晰

感觉大概率是遇到bug了,建议升一下级

1 个赞

结贴
确定bug

Issues · pingcap/tidb · GitHub

1 个赞

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