Skip to content

Commit

Permalink
*: when placement conflicts with tiflash, cancel the job (pingcap#30945)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcwangchao committed Dec 22, 2021
1 parent efb5330 commit b53f349
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ddl/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,7 @@ func (w *worker) onSetTableFlashReplica(t *meta.Meta, job *model.Job) (ver int64
}

if replicaInfo.Count > 0 && tableHasPlacementSettings(tblInfo) {
job.State = model.JobStateCancelled
return ver, errors.Trace(ErrIncompatibleTiFlashAndPlacement)
}

Expand Down Expand Up @@ -1279,6 +1280,7 @@ func onAlterTablePartitionPlacement(t *meta.Meta, job *model.Job) (ver int64, er
}

if tblInfo.TiFlashReplica != nil && tblInfo.TiFlashReplica.Count > 0 {
job.State = model.JobStateCancelled
return 0, errors.Trace(ErrIncompatibleTiFlashAndPlacement)
}

Expand Down Expand Up @@ -1350,6 +1352,7 @@ func onAlterTablePlacement(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64,
}

if tblInfo.TiFlashReplica != nil && tblInfo.TiFlashReplica.Count > 0 {
job.State = model.JobStateCancelled
return 0, errors.Trace(ErrIncompatibleTiFlashAndPlacement)
}

Expand Down

0 comments on commit b53f349

Please sign in to comment.