-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
ddl: cancel job,after met DropTableOrView error #40641
Conversation
Signed-off-by: ystaticy <[email protected]>
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Skipping CI for Draft Pull Request. |
@@ -301,6 +301,7 @@ func onCreateView(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, _ error) | |||
if oldTbInfoID > 0 && orReplace { | |||
err = t.DropTableOrView(schemaID, oldTbInfoID) | |||
if err != nil { | |||
job.State = model.JobStateCancelled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to check oldTbInfoID
after L291
Signed-off-by: ystaticy [email protected]
What problem does this PR solve?
Issue Number: ref #40783
Problem Summary:
I met the error when TiDB call
upgradeToVer94
, upgrade from TiDB 6.2 to TiDB 6.4.If the
create and replace view
ddl job inupgradeToVer94
is interrupted , we may encountertable doesn't exist
(In fact, the old view has been dropped ) inDropTableOrView
when we restart tidb and the rerun the job by old view info.What is changed and how it works?
If we encounter
table doesn't exist
(the old view has been dropped ) the job.State need to be set tomodel.JobStateCancelled
Check List
Tests
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.