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

read operations don't wait for resolving secondary locks #356

Closed
youjiali1995 opened this issue Oct 28, 2021 · 2 comments
Closed

read operations don't wait for resolving secondary locks #356

youjiali1995 opened this issue Oct 28, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@youjiali1995
Copy link
Contributor

Now if a read operation meets a lock, it has to check transaction status and resolve the lock, then it retires to read. Waiting for resolving secondary locks is unnecessary if we can tell TiKV to read through(the lock's transaction is committed) or ignore(the lock's transaction is rolledback) the lock .

@youjiali1995 youjiali1995 added the enhancement New feature or request label Oct 28, 2021
@disksing
Copy link
Collaborator

It is a good point. I think this improvement can be useful for latency-bound scenarios.

@youjiali1995
Copy link
Contributor Author

youjiali1995 commented Nov 18, 2021

I tested it in a workload that all reads meet a lock belonging to a committed transaction, and I injected 50ms write latency to TiKV. With this improvement, write latency doesn't affect read latency.
image

PRs are ready for review @sticnarf @MyonKeminta @you06

  1. kvproto change: kvrpcpb: add committed_locks to Context to improve resolving locks for pingcap/kvproto#833
  2. TiKV supports read-through-lock: *: support read-through lock tikv#11238
  3. Unistore supports read-through-lock: unistore: get/batchGet/scan support read-through-lock pingcap/tidb#29898
  4. Client-go makes use of it: txnkv: read through locks #380
  5. After all PRs are merged, I will update client-go for TiDB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants