@@ -79,7 +79,6 @@ func (txn *tikvTxn) CacheTableInfo(id int64, info *model.TableInfo) {
79
79
80
80
func (txn * tikvTxn ) LockKeys (ctx context.Context , lockCtx * kv.LockCtx , keysInput ... kv.Key ) error {
81
81
keys := toTiKVKeys (keysInput )
82
- txn .exitFairLockingIfInapplicable (ctx , keys )
83
82
err := txn .KVTxn .LockKeys (ctx , lockCtx , keys ... )
84
83
if err != nil {
85
84
return txn .extractKeyErr (err )
@@ -89,7 +88,6 @@ func (txn *tikvTxn) LockKeys(ctx context.Context, lockCtx *kv.LockCtx, keysInput
89
88
90
89
func (txn * tikvTxn ) LockKeysFunc (ctx context.Context , lockCtx * kv.LockCtx , fn func (), keysInput ... kv.Key ) error {
91
90
keys := toTiKVKeys (keysInput )
92
- txn .exitFairLockingIfInapplicable (ctx , keys )
93
91
err := txn .KVTxn .LockKeysFunc (ctx , lockCtx , fn , keys ... )
94
92
if err != nil {
95
93
return txn .extractKeyErr (err )
@@ -357,18 +355,6 @@ func (txn *tikvTxn) UpdateMemBufferFlags(key []byte, flags ...kv.FlagsOp) {
357
355
txn .GetUnionStore ().GetMemBuffer ().UpdateFlags (key , getTiKVFlagsOps (flags )... )
358
356
}
359
357
360
- func (txn * tikvTxn ) exitFairLockingIfInapplicable (ctx context.Context , keys [][]byte ) {
361
- if len (keys ) > 1 && txn .IsInAggressiveLockingMode () {
362
- // Only allow fair locking if it only needs to lock one key. Considering that it's possible that a
363
- // statement causes multiple calls to `LockKeys` (which means some keys may have been locked in fair
364
- // locking mode), here we exit fair locking mode by calling DoneFairLocking instead of cancelling.
365
- // Then the previously-locked keys during execution in this statement (if any) will be turned into the state
366
- // as if they were locked in normal way.
367
- // Note that the issue https://github.com/pingcap/tidb/issues/35682 also exists here.
368
- txn .KVTxn .DoneAggressiveLocking (ctx )
369
- }
370
- }
371
-
372
358
func (txn * tikvTxn ) generateWriteConflictForLockedWithConflict (lockCtx * kv.LockCtx ) error {
373
359
if lockCtx .MaxLockedWithConflictTS != 0 {
374
360
failpoint .Inject ("lockedWithConflictOccurs" , func () {})
0 commit comments