memtx: fix and refactor memtx_tx_history_rollback_stmt
Rollback is rather complicated part if MVCC implementation that is meant to handle two kinds of rollback: * rollback from in-progress state, if box.rollback() is called. * rollback from prepared state, when WAL fails. Unfortunately the last one was not properly tested and surely has at least one flaw. When an inserting transaction becomes prepared its stories could be linked as deleted (via del_stmt pointer) by other in-progress transactions in order to maintain correct visibility. The problem is that in case of rollback of such prepared transaction those links remained. Broken links breaks the chain structure, and some older changes (that were linked as deleted before that hapless preparation) can become visible to other transaction. Refactor, simplify a bit that part of code and fix the issue described above; cover with tests. Closes #8648 NO_DOC=bugfix (cherry picked from commit 85569d9c)
Showing
- changelogs/unreleased/gh-8648-mvcc-broken-rollback-of-prepared.md 4 additions, 0 deletions...gs/unreleased/gh-8648-mvcc-broken-rollback-of-prepared.md
- src/box/memtx_tx.c 108 additions, 21 deletionssrc/box/memtx_tx.c
- test/box-luatest/gh_8648_memtx_mvcc_rollback_prepared_test.lua 157 additions, 0 deletions...box-luatest/gh_8648_memtx_mvcc_rollback_prepared_test.lua
Loading
Please register or sign in to comment