Skip to content

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
CuriousGeorgiy:gh-8104-prepared-del-stmt
Jan 23, 2023
Merged

memtx: fix definition of old story in MVCC insert statement preparation and rollback of prepared statements deleting MVCC stories#8167
alyapunov merged 4 commits intotarantool:masterfrom
CuriousGeorgiy:gh-8104-prepared-del-stmt

Conversation

@CuriousGeorgiy
Copy link
Member

Closes #8104
Closes #7930

@CuriousGeorgiy CuriousGeorgiy force-pushed the gh-8104-prepared-del-stmt branch 5 times, most recently from a3d3f70 to f8e07b0 Compare January 17, 2023 11:57
@CuriousGeorgiy CuriousGeorgiy mentioned this pull request Jan 17, 2023
@CuriousGeorgiy CuriousGeorgiy force-pushed the gh-8104-prepared-del-stmt branch from f8e07b0 to 01ba2fc Compare January 17, 2023 13:43
@coveralls
Copy link

coveralls commented Jan 17, 2023

Coverage Status

Coverage: 85.469% (-0.02%) from 85.49% when pulling 1860b11 on CuriousGeorgiy:gh-8104-prepared-del-stmt into eef0f71
on tarantool:master
.

Copy link
Contributor

@drewdzzz drewdzzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, just a couple of nitpicks.

@CuriousGeorgiy CuriousGeorgiy force-pushed the gh-8104-prepared-del-stmt branch from 01ba2fc to 2bc7f27 Compare January 19, 2023 07:04
@CuriousGeorgiy CuriousGeorgiy changed the title memtx: fix definition of old story in MVCC insert statement preparation memtx: fix definition of old story in MVCC insert statement preparation and rollback of prepared statements deleting MVCC stories Jan 19, 2023
@drewdzzz
Copy link
Contributor

BTW, forgot to tell, some problems with the first commit description

If there exists an older
story in the history chain, but the story, but the story

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
@CuriousGeorgiy CuriousGeorgiy force-pushed the gh-8104-prepared-del-stmt branch from 2bc7f27 to 1860b11 Compare January 19, 2023 09:01
@CuriousGeorgiy
Copy link
Member Author

@drewdzzz thanks for noticing this typo — fixed.

@CuriousGeorgiy CuriousGeorgiy added the full-ci Enables all tests for a pull request label Jan 23, 2023
@alyapunov alyapunov merged commit de938a6 into tarantool:master Jan 23, 2023
@alyapunov
Copy link
Contributor

Backported to 2.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Enables all tests for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assertion failure in memtx transaction manager mvcc loses a committed tuple after a synchronous rollback

4 participants