-
Notifications
You must be signed in to change notification settings - Fork 134
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
TxnLockNotFound #315
Comments
Thanks for your feedback! Confirmed it's a bug. TiKV doesn't actually write mutations whose op are |
Is it a TiKV bug or client-rust's ? |
It's cilent-rust's |
I'd like to try fixing the bug. Any Docs or guide how to do it? |
|
What does primary key means in a tikv transaction? |
The primary key can be viewed as a representative of the transaction. Each transaction that needs to write some key-values must have a primary key. In client-rust, the primary key of a transaction is set at client-rust/src/transaction/buffer.rs Line 12 in eb1d2da
There is a difference in how primary keys are set between TiDB(client-go) and client-rust. cilent-go doesn't set the primary key until committing. client-rust, in the current implementation, can set the primary key when locking keys. I think we may need to consider whether there is a better way to do this. |
Should we change the way how primary key is set to be the same as go? |
That's one way to fix the issue. But it may introduce other subtleties. For example, pessimistic lock requests require a primary key, even when the transaction isn't ready to commit. Maybe we can temporarily set the PK as the key that needs to be locked? We must carefully reason its correctness. I don't have a simple solution for now. @andylokandy do you have any good ideas? |
@ekexium I have a question about the case this PR is going to resolve: what should the PK be if a transaction's mutations contain only one CheckNotExist? e.g.: begin, insert('k1'), delete('k1'), commit |
The above code raise the following error:
Tikv setup:
The text was updated successfully, but these errors were encountered: