Reduce unnecessary check_txn_status for fair lock mode
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Background
Previously, when encountering a lock (whether it is a primary lock or not), the resolveLocks function does not internally check whether the time-to-live (TTL) of the lock has expired. Instead, it immediately starts check_txn_status. For a contended lock, if an AcquirePessimisticLocks timeouts due to high contention, usually it doesn't have to try to resolve the lock. These check_txn_status can be saved.
## Enhancement
When a timeout occurs during waiting for a lock, TiKV provides the duration of time that has passed since the last update of the lock wait. Let the client decide whether it is necessary to resolve locks based on this info.
Ref
- https://github.com/tikv/tikv/issues/14497
Contributor guide
Assessment
This issue has not been assessed yet.