Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce unnecessary check_txn_status for fair lock mode #42717

Open
ekexium opened this issue Mar 31, 2023 · 0 comments
Open

Reduce unnecessary check_txn_status for fair lock mode #42717

ekexium opened this issue Mar 31, 2023 · 0 comments
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@ekexium
Copy link
Member

ekexium commented Mar 31, 2023

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

@ekexium ekexium added the type/enhancement The issue or PR belongs to an enhancement. label Mar 31, 2023
@ekexium ekexium changed the title Reduce unnecessary resolving locks for fair lock mode Reduce unnecessary check_txn_status for fair lock mode Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

1 participant