-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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: fix DDL still blocks if PD down and restart #44295
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
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. |
ddl/ddl_worker.go
Outdated
@@ -481,13 +481,14 @@ func cleanMDLInfo(pool *sess.Pool, jobID int64, ec *clientv3.Client) { | |||
se.SetDiskFullOpt(kvrpcpb.DiskFullOpt_AllowedOnAlmostFull) | |||
_, err := se.Execute(context.Background(), sql, "delete-mdl-info") | |||
if err != nil { | |||
logutil.BgLogger().Warn("unexpected error when clean mdl info", zap.Error(err)) | |||
logutil.BgLogger().Warn("unexpected error when clean mdl info", zap.Int64("job id", jobID), zap.Error(err)) |
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.
logutil.BgLogger().Warn("unexpected error when clean mdl info", zap.Int64("job id", jobID), zap.Error(err)) | |
logutil.BgLogger().Warn("unexpected error when clean mdl info", zap.Int64("job ID", jobID), zap.Error(err)) |
ddl/ddl_worker.go
Outdated
} | ||
if ec != nil { | ||
path := fmt.Sprintf("%s/%d/", util.DDLAllSchemaVersionsByJob, jobID) | ||
_, err = ec.Delete(context.Background(), path, clientv3.WithPrefix()) | ||
if err != nil { | ||
logutil.BgLogger().Warn("[ddl] delete versions failed", zap.Any("job id", jobID), zap.Error(err)) | ||
logutil.BgLogger().Warn("[ddl] delete versions failed", zap.Int64("job id", jobID), zap.Error(err)) |
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.
logutil.BgLogger().Warn("[ddl] delete versions failed", zap.Int64("job id", jobID), zap.Error(err)) | |
logutil.BgLogger().Warn("[ddl] delete versions failed", zap.Int64("job ID", jobID), zap.Error(err)) |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: acb6a00
|
/retest |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #44267
Problem Summary:
It may clean the DML info at ETCD while leaving the MDL info at mysql.tidb_mdl_info.
What is changed and how it works?
Check List
Tests
Run the schrDDL test on a cluster. Kill and restart PD, then check if DDL is blocked.
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.