Force close foreign key's transaction#110
Open
you06 wants to merge 2 commits intopingcap:testing_cifrom
Open
Conversation
Signed-off-by: you06 <you1474600@gmail.com>
Author
|
The invalid statements will happen. |
Signed-off-by: you06 <you1474600@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's changed
Because the foreign key transaction transfer operation contains 2 transactions, the fix #104 can not handle this case.
Force close foreign key's transaction after
with-txncall. This avoids a remaining opened transaction.Root Cause
The foreign key case contains more conflict, and the transaction timeout may cause some weird execution order.
General log of jepsen bank:
SET @@SESSION.autocommit=1is executed between 2 select-for-update statements and exit the transaction unexpectedly. And the following statements are executed in single auto-commit transactions, which break the invariants easily.Jepsen never set variables between those 2 statements.
jepsen/tidb/src/tidb/bank.clj
Lines 106 to 116 in dae83e6
Test
After this change, this type of invalid statement order is eliminated.