Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GC life time is shorter than transaction duration when query information_schema.tables with InfoSchema V2 enable #55515

Closed
lilinghai opened this issue Aug 20, 2024 · 0 comments · Fixed by #55574
Labels
component/ddl This issue is related to DDL of TiDB. feature/developing the related feature is in development severity/major type/bug The issue is confirmed as a bug.

Comments

@lilinghai
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

set schema cache 2gb
prepare 1 million databases and 2 million tables

mysql> select count(*) from information_schema.tables;
ERROR 9006 (HY000): GC life time is shorter than transaction duration, transaction starts at 2024-08-20 07:13:02.343 +0800 CST, GC safe point is 2024-08-20 07:13:24.893 +0800 CST

2. What did you expect to see? (Required)

success

3. What did you see instead (Required)

2024-08-20 07:23:26 (UTC+08:00)TiDB [tc-tidb-1.tc](http://tc-tidb-1.tc/)-tidb-peer.jira-users-master-v2-8jwmv.svc:4000[conn.go:1178] ["command dispatched failed"] [conn=2575313706] [session_alias=] [connInfo="id:2575313706, addr:[10.200.26.63:41812](http://10.200.26.63:41812/) status:10, collation:latin1_swedish_ci, user:root"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="select count(*) from information_schema.tables"] [txn_mode=PESSIMISTIC] [timestamp=0] [err="[tikv:9006]GC life time is shorter than transaction duration, transaction starts at 2024-08-20 07:13:02.343 +0800 CST, GC safe point is 2024-08-20 07:13:24.893 +0800 CST\[ngithub.com/pingcap/errors.AddStack\n\t/go/pkg/mod/github.com/pingcap/[email protected]/errors.go:178\ngithub.com/pingcap/errors.(*Error).GenWithStackByArgs\n\t/go/pkg/mod/github.com/pingcap/[email protected]/normalize.go:175\ngithub.com/pingcap/tidb/pkg/store/driver/error.ToTiDBErr\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/store/driver/error/error.go:150\ngithub.com/pingcap/tidb/pkg/store/driver/txn.extractKeyErr\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/store/driver/txn/error.go:166\ngithub.com/pingcap/tidb/pkg/store/driver/txn.(*tikvSnapshot).Get\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/store/driver/txn/snapshot.go:61\ngithub.com/pingcap/tidb/pkg/structure.(*TxStructure).HGet\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/structure/hash.go:45\ngithub.com/pingcap/tidb/pkg/meta.(*Meta).checkDBExists\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/meta/meta.go:547\ngithub.com/pingcap/tidb/pkg/meta.(*Meta).GetMetasByDBID\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/meta/meta.go:1006\ngithub.com/pingcap/tidb/pkg/meta.(*Meta).ListTables\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/meta/meta.go:1099\ngithub.com/pingcap/tidb/pkg/infoschema.(*infoschemaV2).SchemaTableInfos\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/infoschema/infoschema_v2.go:761\ngithub.com/pingcap/tidb/pkg/planner/core.listTablesForEachSchema\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/core/memtable_infoschema_extractor.go:653\ngithub.com/pingcap/tidb/pkg/planner/core.(*InfoSchemaTablesExtractor).ListSchemasAndTables\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/core/memtable_infoschema_extractor.go:301\ngithub.com/pingcap/tidb/pkg/executor.(*memtableRetriever).setDataFromTables\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/executor/infoschema_reader.go:716\ngithub.com/pingcap/tidb/pkg/executor.(*memtableRetriever).retrieve\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/executor/infoschema_reader.go:133\ngithub.com/pingcap/tidb/pkg/executor.(*MemTableReaderExec).Next\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/executor/memtable_reader.go:120\ngithub.com/pingcap/tidb/pkg/executor/internal/exec.Next\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/executor/internal/exec/executor.go:451\ngithub.com/pingcap/tidb/pkg/executor/aggregate.(*HashAggExec).fetchChildData\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/executor/aggregate/agg_hash_executor.go:482\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650](http://ngithub.com/pingcap/errors.AddStack/n/t/go/pkg/mod/github.com/pingcap/[email protected]/errors.go:178/ngithub.com/pingcap/errors.(*Error).GenWithStackByArgs/n/t/go/pkg/mod/github.com/pingcap/[email protected]/normalize.go:175/ngithub.com/pingcap/tidb/pkg/store/driver/error.ToTiDBErr/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/store/driver/error/error.go:150/ngithub.com/pingcap/tidb/pkg/store/driver/txn.extractKeyErr/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/store/driver/txn/error.go:166/ngithub.com/pingcap/tidb/pkg/store/driver/txn.(*tikvSnapshot).Get/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/store/driver/txn/snapshot.go:61/ngithub.com/pingcap/tidb/pkg/structure.(*TxStructure).HGet/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/structure/hash.go:45/ngithub.com/pingcap/tidb/pkg/meta.(*Meta).checkDBExists/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/meta/meta.go:547/ngithub.com/pingcap/tidb/pkg/meta.(*Meta).GetMetasByDBID/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/meta/meta.go:1006/ngithub.com/pingcap/tidb/pkg/meta.(*Meta).ListTables/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/meta/meta.go:1099/ngithub.com/pingcap/tidb/pkg/infoschema.(*infoschemaV2).SchemaTableInfos/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/infoschema/infoschema_v2.go:761/ngithub.com/pingcap/tidb/pkg/planner/core.listTablesForEachSchema/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/core/memtable_infoschema_extractor.go:653/ngithub.com/pingcap/tidb/pkg/planner/core.(*InfoSchemaTablesExtractor).ListSchemasAndTables/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/planner/core/memtable_infoschema_extractor.go:301/ngithub.com/pingcap/tidb/pkg/executor.(*memtableRetriever).setDataFromTables/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/executor/infoschema_reader.go:716/ngithub.com/pingcap/tidb/pkg/executor.(*memtableRetriever).retrieve/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/executor/infoschema_reader.go:133/ngithub.com/pingcap/tidb/pkg/executor.(*MemTableReaderExec).Next/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/executor/memtable_reader.go:120/ngithub.com/pingcap/tidb/pkg/executor/internal/exec.Next/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/executor/internal/exec/executor.go:451/ngithub.com/pingcap/tidb/pkg/executor/aggregate.(*HashAggExec).fetchChildData/n/t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/executor/aggregate/agg_hash_executor.go:482/nruntime.goexit/n/t/usr/local/go/src/runtime/asm_amd64.s:1650)"]

4. What is your TiDB version? (Required)

Release Version: v8.3.0-alpha
Edition: Community
Git Commit Hash: 336d3a3
Git Branch: heads/refs/tags/v8.3.0-alpha
UTC Build Time: 2024-08-17 11:45:28
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: unistore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/ddl This issue is related to DDL of TiDB. feature/developing the related feature is in development severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants