diff --git a/ddl/ddl.go b/ddl/ddl.go index fec3e64e15..55e0e15269 100644 --- a/ddl/ddl.go +++ b/ddl/ddl.go @@ -561,7 +561,7 @@ func (d *ddl) doDDLJob(ctx sessionctx.Context, job *model.Job) error { continue } - // If a job is a history job, the state must be JobSynced or JobCancel. + // If a job is a history job, the state must be JobStateSynced or JobStateRollbackDone or JobStateCancelled. if historyJob.IsSynced() { log.Infof("[ddl] DDL job ID:%d is finished", jobID) return nil @@ -570,7 +570,7 @@ func (d *ddl) doDDLJob(ctx sessionctx.Context, job *model.Job) error { if historyJob.Error != nil { return errors.Trace(historyJob.Error) } - panic("When the state is JobCancel, historyJob.Error should never be nil") + panic("When the state is JobStateRollbackDone or JobStateCancelled, historyJob.Error should never be nil") } }