[Tarantool-patches] [PATCH v2 1/1] txn: destroy commit and rollback triggers
Cyrill Gorcunov
gorcunov at gmail.com
Mon Apr 26 13:13:29 MSK 2021
On Sun, Apr 25, 2021 at 05:42:35PM +0200, Vladislav Shpilevoy wrote:
> static int
> txn_add_redo(struct txn *txn, struct txn_stmt *stmt, struct request *request)
> {
> @@ -149,8 +146,11 @@ txn_rollback_one_stmt(struct txn *txn, struct txn_stmt *stmt)
> {
> if (txn->engine != NULL && stmt->space != NULL)
> engine_rollback_statement(txn->engine, txn, stmt);
> - if (stmt->has_triggers)
> - txn_run_rollback_triggers(txn, &stmt->on_rollback);
> + if (stmt->has_triggers && trigger_run(&stmt->on_rollback, txn) != 0) {
> + diag_log();
> + unreachable();
> + panic("statement rollback trigger failed");
> + }
> }
Good catch, Vlad! Can we please eliminate these unreachable() calls while
you're modifying it? It is simply not needed (because it is rather a hint
for compiler and in case if the code is executing it leads to unpredicted
results so panic() is only right thing to do).
More information about the Tarantool-patches
mailing list