code: func IsJobRollbackable(job *model.Job) bool {
  	switch job.Type {
  	case model.ActionDropIndex:
  		// We can't cancel if index current state is in StateDeleteOnly or StateDeleteReorganization, otherwise will cause inconsistent between record and index.
  		if job.SchemaState == model.StateDeleteOnly ||
  			job.SchemaState == model.StateDeleteReorganization {
  			return false
  		}
  	case model.ActionDropSchema, model.ActionDropTable:
  		// To simplify the rollback logic, cannot be canceled in the following states.
  		if job.SchemaState == model.StateWriteOnly ||
  			job.SchemaState == model.StateDeleteOnly {
  			return false
  		}
  	case model.ActionDropColumn, model.ActionModifyColumn,
  		model.ActionDropTablePartition, model.ActionAddTablePartition,
  		model.ActionRebaseAutoID, model.ActionShardRowID,
  		model.ActionTruncateTable, model.ActionAddForeignKey,
  		model.ActionDropForeignKey, model.ActionRenameTable,
  		model.ActionModifyTableCharsetAndCollate, model.ActionTruncateTablePartition:
  		return job.SchemaState == model.StateNone
  	}
  	return true
  }
docs: // IsJobRollbackable checks whether the job can be rollback.