Skip to content

Commit

Permalink
fix point get read pessimistic lock cache
Browse files Browse the repository at this point in the history
Signed-off-by: you06 <[email protected]>
  • Loading branch information
you06 committed Jan 30, 2025
1 parent 79fc917 commit 7c98d0e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pkg/executor/point_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,15 +655,16 @@ func (e *PointGetExecutor) get(ctx context.Context, key kv.Key) ([]byte, error)
if !kv.IsErrNotFound(err) {
return nil, err
}
// key does not exist in mem buffer, check the lock cache
if e.lock {
var ok bool
val, ok = e.Ctx().GetSessionVars().TxnCtx.GetKeyInPessimisticLockCache(key)
if ok {
return val, nil
}
// fallthrough to pessimistic lock cache & snapshot get.
}

// key does not exist in mem buffer, check the lock cache
if e.lock {
var ok bool
val, ok = e.Ctx().GetSessionVars().TxnCtx.GetKeyInPessimisticLockCache(key)
if ok {
return val, nil
}
// fallthrough to snapshot get.
}

lock := e.tblInfo.Lock
Expand Down

0 comments on commit 7c98d0e

Please sign in to comment.