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

binlog.schemaVersion is 0 for flaskback cluster, and unlock tables when last table doesn't exist #58049

Open
D3Hunter opened this issue Dec 6, 2024 · 0 comments
Labels
component/ddl This issue is related to DDL of TiDB. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@D3Hunter
Copy link
Contributor

D3Hunter commented Dec 6, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

right now binlog.schemaVersion is used by CDC to decide when or whether to run the DDL, and binlog.schemaVersion might be 0 when the DDL is skipped due to if not exist, if exist and alter table cache/no cache but table is already in the expect state

but for below cases, binlog.schemaVersion is also 0. as CDC don't sync below types of DDL right now, will mark this issue as moderate

binlog info are not set for flaskback cluster,so binlog.schemaVersion is always 0

tidb/pkg/ddl/cluster.go

Lines 834 to 836 in bb9096c

job.State = model.JobStateDone
job.SchemaState = model.StatePublic
return updateSchemaVersion(jobCtx, job)

for unlock table when last table doesn't exist, the final binlog.schemaVersion is also 0

tidb/pkg/ddl/table_lock.go

Lines 179 to 184 in bb9096c

if infoschema.ErrDatabaseNotExists.Equal(err) || infoschema.ErrTableNotExists.Equal(err) {
// The table maybe has been dropped. just ignore this err and go on.
args.IndexOfUnlock++
job.FillArgs(args)
return ver, nil
}

tidb/pkg/ddl/table_lock.go

Lines 234 to 237 in bb9096c

ver, err = unlockTables(jobCtx, job, args)
if args.IndexOfUnlock == len(args.UnlockTables) {
job.FinishTableJob(model.JobStateDone, model.StateNone, ver, nil)
}

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

master

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. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants