Skip to content

Commit

Permalink
ddl: fix DDL still blocks if PD down and restart (pingcap#44295)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjhuang2016 committed Jun 1, 2023
1 parent 83b8090 commit 78e2faf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ddl/ddl_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,13 +536,14 @@ func cleanMDLInfo(pool *sessionPool, jobID int64, ec *clientv3.Client) {
sess.SetDiskFullOpt(kvrpcpb.DiskFullOpt_AllowedOnAlmostFull)
_, err := sess.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))
return
}
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))
}
}
}
Expand Down

0 comments on commit 78e2faf

Please sign in to comment.