Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
shardddl: fix lock not found after try sync (#939) (#944)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-srebot authored Aug 28, 2020
1 parent c8f2949 commit a358aca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dm/master/shardddl/optimist.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,10 @@ func (o *Optimist) handleLock(info optimism.Info, tts []optimism.TargetTable, sk

lock := o.lk.FindLock(lockID)
if lock == nil {
// this should not happen.
o.logger.Warn("lock not found after try sync for shard DDL info", zap.String("lock", lockID), zap.Stringer("info", info))
return nil
// this aways means others remove the lock concurrently when resolved ddl.
// simply try again.
o.logger.Warn("lock not found after try sync for shard DDL info, try handle lock again", zap.String("lock", lockID), zap.Stringer("info", info))
return o.handleLock(info, tts, skipDone)
}

// check whether the lock has resolved.
Expand Down

0 comments on commit a358aca

Please sign in to comment.