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

Unexpected full reload caused by failing to load schema diff #53442

Closed
wjhuang2016 opened this issue May 21, 2024 · 0 comments · Fixed by #53543
Closed

Unexpected full reload caused by failing to load schema diff #53442

wjhuang2016 opened this issue May 21, 2024 · 0 comments · Fixed by #53543
Assignees
Labels
component/ddl This issue is related to DDL of TiDB. feature/developing the related feature is in development severity/minor type/bug The issue is confirmed as a bug. type/regression

Comments

@wjhuang2016
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. Enable info schema cache V2 by setting DefTiDBSchemaCacheSize to 10.
  2. Add
	tk.MustExec(`drop view sys.schema_unused_indexes;`)

to the last of the test TestTimeBoundedStalenessTxn
3. Test TestTimeBoundedStalenessTxn and check log.

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

Partial reload for drop view sys.schema_unused_indexes

3. What did you see instead (Required)

[2024/05/21 16:14:36.358 +08:00] [INFO] [ddl.go:1182] ["start DDL job"] [category=ddl] [job="ID:106, Type:drop view, State:queueing, SchemaState:public, SchemaID:100, TableID:102, RowCount:0, ArgLen:0, start time: 2024-05-21 16:14:36.357 +0800 CST, Err:<nil>, ErrCount:0, SnapshotVersion:0, LocalMode: false"] [query="drop view sys.schema_unused_indexes;"]
[2024/05/21 16:14:36.359 +08:00] [INFO] [ddl_worker.go:1212] ["run DDL job"] [worker="worker 4, tp general"] [category=ddl] [jobID=106] [conn=1] [category=ddl] [job="ID:106, Type:drop view, State:queueing, SchemaState:public, SchemaID:100, TableID:102, RowCount:0, ArgLen:0, start time: 2024-05-21 16:14:36.357 +0800 CST, Err:<nil>, ErrCount:0, SnapshotVersion:0, LocalMode: false"]
[2024/05/21 16:14:36.360 +08:00] [ERROR] [domain.go:364] ["failed to load schema diff"] [error="[schema:1049]Unknown database '(Schema ID 100)'"] [errorVerbose="[schema:1049]Unknown database '(Schema ID 100)'\ngithub.com/pingcap/errors.AddStack\n\t/Users/bba/.gvm/pkgsets/go1.21.0/global/pkg/mod/github.com/pingcap/errors@v0.11.5-0.20240318064555-6bd07397691f/errors.go:178\ngithub.com/pingcap/errors.(*Error).GenWithStackByArgs\n\t/Users/bba/.gvm/pkgsets/go1.21.0/global/pkg/mod/github.com/pingcap/errors@v0.11.5-0.20240318064555-6bd07397691f/normalize.go:175\ngithub.com/pingcap/tidb/pkg/infoschema.(*Builder).applyTableUpdateV2\n\t/Users/bba/pc/tidb/pkg/infoschema/infoschema_v2.go:815\ngithub.com/pingcap/tidb/pkg/infoschema.applyTableUpdate\n\t/Users/bba/pc/tidb/pkg/infoschema/infoschema_v2.go:714\ngithub.com/pingcap/tidb/pkg/infoschema.applyDefaultAction\n\t/Users/bba/pc/tidb/pkg/infoschema/builder.go:315\ngithub.com/pingcap/tidb/pkg/infoschema.(*Builder).ApplyDiff\n\t/Users/bba/pc/tidb/pkg/infoschema/builder.go:102\ngithub.com/pingcap/tidb/pkg/domain.(*Domain).tryLoadSchemaDiffs\n\t/Users/bba/pc/tidb/pkg/domain/domain.go:544\ngithub.com/pingcap/tidb/pkg/domain.(*Domain).loadInfoSchema\n\t/Users/bba/pc/tidb/pkg/domain/domain.go:349\ngithub.com/pingcap/tidb/pkg/domain.(*Domain).Reload\n\t/Users/bba/pc/tidb/pkg/domain/domain.go:679\ngithub.com/pingcap/tidb/pkg/domain.(*Domain).loadSchemaInLoop\n\t/Users/bba/pc/tidb/pkg/domain/domain.go:992\ngithub.com/pingcap/tidb/pkg/domain.(*Domain).Init.func2\n\t/Users/bba/pc/tidb/pkg/domain/domain.go:1360\ngithub.com/pingcap/tidb/pkg/util.(*WaitGroupEnhancedWrapper).Run.func1\n\t/Users/bba/pc/tidb/pkg/util/wait_group_wrapper.go:99\nruntime.goexit\n\t/Users/bba/.gvm/gos/go1.21.0/src/runtime/asm_arm64.s:1197"] [stack="github.com/pingcap/tidb/pkg/domain.(*Domain).loadInfoSchema\n\t/Users/bba/pc/tidb/pkg/domain/domain.go:364\ngithub.com/pingcap/tidb/pkg/domain.(*Domain).Reload\n\t/Users/bba/pc/tidb/pkg/domain/domain.go:679\ngithub.com/pingcap/tidb/pkg/domain.(*Domain).loadSchemaInLoop\n\t/Users/bba/pc/tidb/pkg/domain/domain.go:992\ngithub.com/pingcap/tidb/pkg/domain.(*Domain).Init.func2\n\t/Users/bba/pc/tidb/pkg/domain/domain.go:1360\ngithub.com/pingcap/tidb/pkg/util.(*WaitGroupEnhancedWrapper).Run.func1\n\t/Users/bba/pc/tidb/pkg/util/wait_group_wrapper.go:99"]
[2024/05/21 16:14:36.369 +08:00] [INFO] [domain.go:388] ["full load InfoSchema success"] [currentSchemaVersion=52] [neededSchemaVersion=53] ["start time"=9.231875ms]

4. What is your TiDB version? (Required)

master

@wjhuang2016 wjhuang2016 added the type/bug The issue is confirmed as a bug. label May 21, 2024
@jebter jebter added feature/developing the related feature is in development component/ddl This issue is related to DDL of TiDB. labels May 22, 2024
@tiancaiamao tiancaiamao self-assigned this May 24, 2024
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/minor type/bug The issue is confirmed as a bug. type/regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants