txn: fix on_rollback trigger args for txns aborted by yield/timeout
Currently, if a transaction is aborted by a fiber yield or by a timeout, txn_rollback_to_svp() is called to rollback all statements of the txn. After that the transaction is completely aborted on attempt to commit it. If an on_rollback trigger is set, it is called from txn_complete_fail(), however it receives an empty iterator, because at this point the statements are already destroyed. This patch invokes on_rollback triggers directly from txn_rollback_to_svp() for abort-by-yield, and postpones the rollback for abort-by-timeout. Closes #9340 NO_DOC=bugfix
Showing
- changelogs/unreleased/gh-9340-fix-on_rollback-function-args.md 5 additions, 0 deletions...elogs/unreleased/gh-9340-fix-on_rollback-function-args.md
- src/box/txn.c 37 additions, 5 deletionssrc/box/txn.c
- test/engine-luatest/gh_9340_on_rollback_trigger_args_test.lua 173 additions, 0 deletions.../engine-luatest/gh_9340_on_rollback_trigger_args_test.lua
Loading
Please register or sign in to comment