-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Atomicity may be broken for a committed transaction whose primary is locked in fair-locking mode and a stale pessimistic lock request arrives after committing #43540
Labels
affects-7.1
severity/major
sig/transaction
SIG:Transaction
type/bug
The issue is confirmed as a bug.
Comments
30 tasks
ti-chi-bot
bot
added
may-affects-5.1
This bug maybe affects 5.1.x versions.
may-affects-5.2
This bug maybe affects 5.2.x versions.
may-affects-5.3
This bug maybe affects 5.3.x versions.
may-affects-5.4
This bug maybe affects 5.4.x versions.
may-affects-6.1
may-affects-6.5
may-affects-7.1
labels
May 5, 2023
MyonKeminta
added
affects-7.1
and removed
may-affects-5.1
This bug maybe affects 5.1.x versions.
may-affects-5.2
This bug maybe affects 5.2.x versions.
may-affects-5.3
This bug maybe affects 5.3.x versions.
may-affects-5.4
This bug maybe affects 5.4.x versions.
may-affects-6.1
may-affects-6.5
may-affects-7.1
labels
May 5, 2023
This was referenced May 6, 2023
Merged
ti-chi-bot bot
pushed a commit
to tikv/tikv
that referenced
this issue
May 29, 2023
… lock resolve (#14692) ref #13298, ref pingcap/tidb#43540 Signed-off-by: cfzjywxk <[email protected]>
12 tasks
12 tasks
Fixed by tikv/tikv#14692 |
/remove-severity critical |
ti-chi-bot
bot
added
may-affects-5.4
This bug maybe affects 5.4.x versions.
may-affects-6.1
may-affects-6.5
may-affects-7.5
may-affects-8.1
labels
Jul 15, 2024
/remove-label may-affects-5.4 |
ti-chi-bot
bot
removed
may-affects-5.4
This bug maybe affects 5.4.x versions.
may-affects-6.1
may-affects-6.5
may-affects-7.5
may-affects-8.1
labels
Jul 15, 2024
@fubinzh Why is this major? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects-7.1
severity/major
sig/transaction
SIG:Transaction
type/bug
The issue is confirmed as a bug.
Bug Report
Consider the following procedure:
k1
in fair locking mode.k1
become the transaction's primary.k2
.k1
) is successfully committed, and it reports a successful state to the client. Its secondaries are prewritten but not committed yet.k1
(optional)PessimisticLock
request of step1. It successfully locksk1
since it allows locking with conflict.k2
, and finds T1's secondary lock. So it tries to resolve the lock.CheckTxnStatus
onk1
which is the primary of trasnaction T1.CheckTxnStatus
finds the pessimistic lock of T1 on keyk1
. If the lock's TTL has expired (it'll happen eventually), thenCheckTxnStatus
will rollback the lock and return a rolled back state to the client (TiDB). Then T2 can rollback the lock onk2
, which breaks T1's atomicity.This is somewhat similar to tikv/tikv#14311 . The RPC request replaying after a long time (transaction does some retries and then successfully commit) should be very very unlikely to happen, but it's theoretically possible.
The text was updated successfully, but these errors were encountered: