Skip to content

Commit

Permalink
store/tikv: do not backoff when PessimisticLock return locked error (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao authored and sre-bot committed Nov 4, 2019
1 parent 6dfe2f2 commit 66a311c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions store/tikv/2pc.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,15 +719,12 @@ func (action actionPessimisticLock) handleSingleBatch(c *twoPhaseCommitter, bo *
}
locks = append(locks, lock)
}
var expire int64
expire, err = c.store.lockResolver.ResolveLocks(bo, c.startTS, locks)
// Because we already waited on tikv, no need to Backoff here.
_, err = c.store.lockResolver.ResolveLocks(bo, c.startTS, locks)
if err != nil {
return errors.Trace(err)
}

if err1 := bo.BackoffWithMaxSleep(BoTxnLock, int(expire), errors.New(locks[0].String())); err1 != nil {
return err1
}
// Handle the killed flag when waiting for the pessimistic lock.
// When a txn runs into LockKeys() and backoff here, it has no chance to call
// executor.Next() and check the killed flag.
Expand Down

0 comments on commit 66a311c

Please sign in to comment.