limbo: fix commit/rollback failures with triggers
Currently some transactions on synchronous space fail to complete with the `ER_CURSOR_NO_TRANSACTION` error, when on_rollback/on_commit triggers are set. This is caused due to the fact, that some rollback/commit triggers require in_txn fiber variable to be set but it's not done when a transaction is completed from the limbo. Callbacks, which are used to work with iterators (`lbox_txn_pairs` and `lbox_txn_iterator_next`), acquire tnx statements from the current transactions, but they cannot do that, when this transaction is not assigned to the current fiber, so `ER_CURSOR_NO_TRANSACTION` is thrown. Let's assign in_txn variable when we complete transaction from the limbo. Moreover, let's add assertions, which check whether in_txn() is correct, in order to be sure, that `txn_complete_success/fail` always run with in_txn set. Closes #8505 NO_DOC=bugfix (cherry picked from commit 6fadc8a0)
parent
d0a6788e
No related branches found
No related tags found
Showing
- changelogs/unreleased/gh-8505-synchro-triggers-fail.md 5 additions, 0 deletionschangelogs/unreleased/gh-8505-synchro-triggers-fail.md
- src/box/txn.c 2 additions, 0 deletionssrc/box/txn.c
- src/box/txn_limbo.c 19 additions, 3 deletionssrc/box/txn_limbo.c
- test/replication-luatest/gh_8505_synchro_triggers_test.lua 80 additions, 0 deletionstest/replication-luatest/gh_8505_synchro_triggers_test.lua
Loading
Please register or sign in to comment