Skip to content

Commit

Permalink
set skip and redirect error message for now
Browse files Browse the repository at this point in the history
  • Loading branch information
lichunzhu committed Mar 17, 2022
1 parent a458bf7 commit 3345f53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions dm/dm/master/shardddl/optimist.go
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ func (o *Optimist) handleLock(info optimism.Info, tts []optimism.TargetTable, sk
switch {
case terror.ErrShardDDLOptimismNeedSkipAndRedirect.Equal(err):
cfStage = optimism.ConflictSkipWaitRedirect
cfMsg = err.Error()
o.logger.Warn("Please make sure all sharding tables execute this DDL in order", log.ShortError(err))
case terror.ErrShardDDLOptimismTrySyncFail.Equal(err):
cfStage = optimism.ConflictDetected
Expand Down
8 changes: 3 additions & 5 deletions dm/syncer/optimist.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,11 @@ func (s *Syncer) handleQueryEventOptimistic(qec *queryEventContext) error {
}
}

if op.ConflictStage == optimism.ConflictError {
return terror.ErrSyncerShardDDLConflict.Generate(qec.needHandleDDLs, op.ConflictMsg)
}
// TODO: support redirect for DM worker
// return error to pass IT now
if op.ConflictStage == optimism.ConflictSkipWaitRedirect {
return terror.ErrSyncerShardDDLConflict.Generate(qec.needHandleDDLs, "there will be conflicts if DDLs .* are applied to the downstream. old table info: .*, new table info: .*")
switch op.ConflictStage {
case optimism.ConflictError, optimism.ConflictSkipWaitRedirect:
return terror.ErrSyncerShardDDLConflict.Generate(qec.needHandleDDLs, op.ConflictMsg)
}

// updated needHandleDDLs to DDLs received from DM-master.
Expand Down

0 comments on commit 3345f53

Please sign in to comment.