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

shardddl: fix lock not found after try sync (#939) #944

Merged
merged 4 commits into from
Aug 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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