pingcap / pingcap/tidb

Reduce unnecessary check_txn_status for fair lock mode

Open
#42,717 0 comments 0 reactions 0 assignees View on GitHub
type/enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.