Skip to content

Commit

Permalink
double check policy exits
Browse files Browse the repository at this point in the history
  • Loading branch information
sylzd committed Oct 8, 2021
1 parent 3dc19b2 commit bdf86be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ddl/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ func onModifySchemaDefaultPlacement(t *meta.Meta, job *model.Job) (ver int64, _
if err != nil {
return ver, errors.Trace(err)
}
//Double Check if policy exits while ddl executing
_, err = checkPlacementPolicyExistAndCancelNonExistJob(t, job, placementPolicyRef.ID)
if err != nil {
return ver, errors.Trace(err)
}

// Notice: dbInfo.DirectPlacementOpts and dbInfo.PlacementPolicyRef can not be both not nil, which checked before constructing ddl job.
// So that we can just check the two situation that do not need ddl: 1. DB.DP == DDL.DP && nil == nil 2. nil == nil && DB.PP == DDL.PP
Expand Down

0 comments on commit bdf86be

Please sign in to comment.