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

executor: Lock the key only if it exists in the tikv for RC isolation #36833

Closed
TonsnakeLin opened this issue Aug 3, 2022 · 0 comments · Fixed by #36834
Closed

executor: Lock the key only if it exists in the tikv for RC isolation #36833

TonsnakeLin opened this issue Aug 3, 2022 · 0 comments · Fixed by #36834
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@TonsnakeLin
Copy link
Contributor

TonsnakeLin commented Aug 3, 2022

Enhancement

  1. current process
    For RC isolation, TiDB currently sends a get request to judge whether the keys exists on the TiKV firstly, then sends a pessimistic lock request to TiKV if the key exists, It makes an additional rpc request.

  2. what changed
    We add a flag LockIfExists for pessimistic lock request and TiKV will check the flag to decide how to execute the lock process. TiDB only send a pessimistic lock request to TiKV. If the keys exist, TiKV locks the keys and return the values of the keys, else does nothing and return.

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

Successfully merging a pull request may close this issue.

1 participant