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

some schema level DDLs are not considered in dependency check #52795

Closed
D3Hunter opened this issue Apr 22, 2024 · 2 comments · Fixed by #54110
Closed

some schema level DDLs are not considered in dependency check #52795

D3Hunter opened this issue Apr 22, 2024 · 2 comments · Fixed by #54110
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. 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

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

currently we only consider DropSchema for schema level check, but not for RecoverSchema, and there are ModifySchemaCharsetAndCollate and ModifySchemaDefaultPlacement that might need to consider too.

tidb/pkg/ddl/job_table.go

Lines 232 to 236 in 79c1499

sql := fmt.Sprintf("select job_id from mysql.tidb_ddl_job where "+
"(CONCAT(',', schema_ids, ',') REGEXP CONCAT(',', %s, ',') != 0 and type = %d and processing) "+
"or (CONCAT(',', table_ids, ',') REGEXP CONCAT(',', %s, ',') != 0 and processing) "+
"or (type = %d and processing) limit 1",
strconv.Quote(strconv.FormatInt(job.SchemaID, 10)), model.ActionDropSchema, strconv.Quote(strconv.FormatInt(job.TableID, 10)), model.ActionFlashbackCluster)

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

master

@D3Hunter D3Hunter added the type/bug The issue is confirmed as a bug. label Apr 22, 2024
@lance6716
Copy link
Contributor

I suspect runningJobs already use unfinishedSchema to filter them. How about we remove these SQL based check? I can open a PR if you agree with it @wjhuang2016 @tangenta

@D3Hunter
Copy link
Contributor Author

I suspect runningJobs already use unfinishedSchema to filter them. How about we remove these SQL based check? I can open a PR if you agree with it @wjhuang2016 @tangenta

i record it in the doc, the SQL based check will be removed

@lance6716 lance6716 added affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. labels Jun 17, 2024
@lance6716 lance6716 added the affects-5.4 This bug affects the 5.4.x(LTS) versions. label Jun 17, 2024
@ti-chi-bot ti-chi-bot bot removed the may-affects-5.4 This bug maybe affects 5.4.x versions. label Jun 17, 2024
@lance6716 lance6716 added severity/moderate may-affects-5.4 This bug maybe affects 5.4.x versions. and removed severity/major labels Jun 17, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in 324ee4c Jun 24, 2024
@D3Hunter D3Hunter removed affects-5.4 This bug affects the 5.4.x(LTS) versions. may-affects-5.4 This bug maybe affects 5.4.x versions. affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. labels Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. 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

Successfully merging a pull request may close this issue.

3 participants