txn: undo commit/rollback triggers when reverting to savepoint
When reverting to a savepoint inside a DDL transaction, apart from undoing changes done by the DDL statements to the system spaces, we also have to - Run rollback triggers installed after the savepoint was set, because otherwise changes done to the schema by DDL won't be undone. - Remove commit triggers installed after the savepoint, because they are not relevant anymore, apparently. To achieve that let's append DDL triggers right to txn statements. This allows us to easily discard commit triggers and run rollback triggers when a statement is rolled back. Note, txn commit/rollback triggers are not removed, because they are still used by applier and Lua box.on_commit/on_rollback functions. Closes #4364 Closes #4365
Showing
- src/box/alter.cc 45 additions, 45 deletionssrc/box/alter.cc
- src/box/txn.c 42 additions, 11 deletionssrc/box/txn.c
- src/box/txn.h 34 additions, 0 deletionssrc/box/txn.h
- test/box/transaction.result 39 additions, 0 deletionstest/box/transaction.result
- test/box/transaction.test.lua 23 additions, 0 deletionstest/box/transaction.test.lua
Loading
Please register or sign in to comment