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

When PD leader switches, SchemaChecker may return ErrInfoSchemaExpired #55487

Closed
lance6716 opened this issue Aug 19, 2024 · 1 comment · Fixed by #55498
Closed

When PD leader switches, SchemaChecker may return ErrInfoSchemaExpired #55487

lance6716 opened this issue Aug 19, 2024 · 1 comment · Fixed by #55498
Assignees
Labels
component/lightning This issue is related to Lightning of TiDB. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@lance6716
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

https://do.pingcap.net/jenkins/blue/organizations/jenkins/pingcap%2Ftidb%2Fpull_lightning_integration_test/detail/pull_lightning_integration_test/1084/pipeline

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

3. What did you see instead (Required)

[2024/08/16 19:09:35.821 +08:00] [INFO] [session.go:4061] ["CRUCIAL OPERATION"] [conn=2283798532] [schemaVersion=51] [cur_db=] [sql="CREATE DATABASE IF NOT EXISTS `cpeng`;"] [user=root@%]
[2024/08/16 19:09:40.837 +08:00] [WARN] [session.go:816] ["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=true] [InRestrictedSQL=true] [tidb_retry_limit=10] [tidb_disable_txn_auto_retry=true]

the 5 second interval equals to SchemaOutOfDateRetryInterval * SchemaOutOfDateRetryTimes

tidb.log

4. What is your TiDB version? (Required)

@lance6716 lance6716 added type/bug The issue is confirmed as a bug. severity/moderate labels Aug 19, 2024
@lance6716
Copy link
Contributor Author

lance6716 commented Aug 19, 2024

start TS is expired

[2024/08/19 11:41:21.349 +08:00] [INFO] [schema_checker.go:82] ["lance test"] [stack="github.com/pingcap/tidb/pkg/domain.(*SchemaChecker).CheckBySchemaVer\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/domain/schema_checker.go:82\ngithub.com/tikv/client-go/v2/txnkv/transaction.(*twoPhaseCommitter).checkSchemaValid\n\t/go/pkg/mod/github.com/tikv/client-go/[email protected]/txnkv/transaction/2pc.go:1870\ngithub.com/tikv/client-go/v2/txnkv/transaction.(*twoPhaseCommitter).execute\n\t/go/pkg/mod/github.com/tikv/client-go/[email protected]/txnkv/transaction/2pc.go:1694\ngithub.com/tikv/client-go/v2/txnkv/transaction.(*KVTxn).Commit\n\t/go/pkg/mod/github.com/tikv/client-go/[email protected]/txnkv/transaction/txn.go:714\ngithub.com/pingcap/tidb/pkg/store/driver/txn.(*tikvTxn).Commit\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/store/driver/txn/txn_driver.go:117\ngithub.com/pingcap/tidb/pkg/session.(*LazyTxn).Commit\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/session/txn.go:449\ngithub.com/pingcap/tidb/pkg/session.(*session).commitTxnWithTemporaryData\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/session/session.go:668\ngithub.com/pingcap/tidb/pkg/session.(*session).doCommit\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/session/session.go:548\ngithub.com/pingcap/tidb/pkg/session.(*session).doCommitWithRetry\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/session/session.go:790\ngithub.com/pingcap/tidb/pkg/session.(*session).CommitTxn\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/session/session.go:921\ngithub.com/pingcap/tidb/pkg/ddl/session.(*Session).Commit\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/ddl/session/session.go:55\ngithub.com/pingcap/tidb/pkg/ddl.genGIDAndCallWithRetry.func1\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/ddl/job_submitter.go:522\ngithub.com/pingcap/tidb/pkg/ddl.genGIDAndCallWithRetry\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/ddl/job_submitter.go:523\ngithub.com/pingcap/tidb/pkg/ddl.GenGIDAndInsertJobsWithRetry\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/ddl/job_submitter.go:401\ngithub.com/pingcap/tidb/pkg/ddl.(*ddl).addBatchDDLJobs2Table\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/ddl/job_submitter.go:323\ngithub.com/pingcap/tidb/pkg/ddl.(*ddl).addBatchDDLJobs\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/ddl/job_submitter.go:90\ngithub.com/pingcap/tidb/pkg/ddl.(*ddl).limitDDLJobs\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/ddl/job_submitter.go:64\ngithub.com/pingcap/tidb/pkg/ddl.(*ddl).Start.func1\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/ddl/ddl.go:720\ngithub.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run.func1\n\t/home/jenkins/agent/workspace/pingcap/tidb/pull_lightning_integration_test/tidb/pkg/util/wait_group_wrapper.go:157"] [txnTS=451946608852730024] [startSchemaVer.SchemaMetaVersion()=51] [relatedTableIDs="[281474976710654]"] [needCheckSchema=false] [restartSchemaVer=0] [latestSchemaVer=51] [latestSchemaExpire=2024/08/19 11:51:32.997 +08:00]
$ tiup ctl:nightly pd tso 451946608852730024
Starting component `ctl`: /Users/lance6716/.tiup/components/ctl/v8.3.0-alpha-nightly/ctl pd tso 451946608852730024
system:  2024-08-19 11:51:32.999 +0800 CST
logic:   168

@lance6716 lance6716 self-assigned this Aug 19, 2024
@jebter jebter added the component/lightning This issue is related to Lightning of TiDB. label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/lightning This issue is related to Lightning of TiDB. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants