Skip to content

Commit

Permalink
ddl: fix DDL still blocks if PD down and restart (pingcap#44295) (pin…
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Jun 1, 2023
1 parent 8fc3eaf commit 3c46ac7
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 3c46ac7

Please sign in to comment.