memtx: fix definition of old story in MVCC insert statement preparation and rollback of prepared statements deleting MVCC stories#8167
Merged
alyapunov merged 4 commits intotarantool:masterfrom Jan 23, 2023
Conversation
a3d3f70 to
f8e07b0
Compare
Closed
f8e07b0 to
01ba2fc
Compare
drewdzzz
approved these changes
Jan 19, 2023
Contributor
drewdzzz
left a comment
There was a problem hiding this comment.
OK, just a couple of nitpicks.
test/box-luatest/gh_8104_memtx_mvcc_assertion_failure_during_stmt_preparation_test.lua
Show resolved
Hide resolved
01ba2fc to
2bc7f27
Compare
Contributor
|
BTW, forgot to tell, some problems with the first commit description
|
During preparation of insert statements in MVCC, we define an old story and abort all transactions that delete this story. If there exists an older story in the history chain, but the story is deleted by a prepared (not necessarily committed) transaction, we consider that it de-facto does not exist anymore — this logic is consistent, since during preparation of the transaction deleting this story, the conflict resolution described above was already done. In this manner, there can be no more than one prepared statement deleting a story at any point in time. Closes tarantool#8104 NO_DOC=bugfix
Currently, if transaction preparation fails, the transaction is left in an inconsistent state: it has a PSN assigned to it, but its status is not 'prepared' — fix this by resetting its PSN. Needed for tarantool#7930 NO_CHANGELOG=refactoring NO_DOC=refactoring NO_TEST=refactoring
During transaction rollback, we unconditionally assign a PSN to it: we should do this only when necessary, i.e., a transaction is RW and is not already prepared. Needed for tarantool#7930 NO_CHANGELOG=refactoring NO_DOC=refactoring NO_TEST=refactoring
When we rollback a prepared statement that deletes an MVCC story, we need to reset the deleted story's PSN. Closes tarantool#7930 NO_DOC=bugfix
2bc7f27 to
1860b11
Compare
Member
Author
|
@drewdzzz thanks for noticing this typo — fixed. |
alyapunov
approved these changes
Jan 23, 2023
Contributor
|
Backported to 2.10. |
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.
Closes #8104
Closes #7930