box: fix rollback of read-only transaction statements
Existence of txn_commit_ro_stmt assumes there is txn_rollback_ro_stmt, but it does not exist. Instead, currently we use txn_rollback_stmt, which has nothing to do with 'ro' statements, and will just rollback the currently running normal statement. As an example, consider box_index_iterator. It calls txn_begin_ro_stmt, which does not produce any artefacts in an existing `struct txn`. But in case of the iterator creation fail it calls txn_rollback_stmt, which will rollback the currently being executed 'rw' statement. Drop txn_commit_ro_stmt and introduce txn_end_ro_stmt, which is called regardless of 'ro' statement result. NO_DOC=bugfix Closes #5501
Showing
- changelogs/unreleased/gh-5501-rollback-txn-ro-stmt.md 4 additions, 0 deletionschangelogs/unreleased/gh-5501-rollback-txn-ro-stmt.md
- src/box/box.cc 4 additions, 5 deletionssrc/box/box.cc
- src/box/index.cc 10 additions, 20 deletionssrc/box/index.cc
- src/box/memtx_tree.cc 5 additions, 0 deletionssrc/box/memtx_tree.cc
- src/box/sql.c 2 additions, 4 deletionssrc/box/sql.c
- src/box/txn.c 2 additions, 0 deletionssrc/box/txn.c
- src/box/txn.h 4 additions, 1 deletionsrc/box/txn.h
- src/box/vinyl.c 5 additions, 0 deletionssrc/box/vinyl.c
- src/lib/core/errinj.h 1 addition, 0 deletionssrc/lib/core/errinj.h
- test/box/errinj.result 1 addition, 0 deletionstest/box/errinj.result
- test/engine-luatest/gh_5501_errinj_index_iterator_new_test.lua 47 additions, 0 deletions...engine-luatest/gh_5501_errinj_index_iterator_new_test.lua
Loading
Please register or sign in to comment