Skip to content

Commit

Permalink
ddl: quickly process the next job after processing the cancelled DDL …
Browse files Browse the repository at this point in the history
…job (#24146)
  • Loading branch information
zimulala authored Apr 25, 2021
1 parent c250425 commit 6344f7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ddl/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ func (d *ddl) doDDLJob(ctx sessionctx.Context, job *model.Job) error {
}

if historyJob.Error != nil {
logutil.BgLogger().Info("[ddl] DDL job is failed", zap.Int64("jobID", jobID))
return errors.Trace(historyJob.Error)
}
// Only for JobStateCancelled job which is adding columns or drop columns.
Expand Down
2 changes: 1 addition & 1 deletion ddl/ddl_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ func (w *worker) handleDDLJobQueue(d *ddlCtx) error {
d.mu.hook.OnJobUpdated(job)
d.mu.RUnlock()

if job.IsSynced() || job.IsCancelled() {
if job.IsSynced() || job.IsCancelled() || job.IsRollbackDone() {
asyncNotify(d.ddlJobDoneCh)
}
}
Expand Down

0 comments on commit 6344f7a

Please sign in to comment.