Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 1/1] txn: destroy commit and rollback triggers
Date: Mon, 26 Apr 2021 13:13:29 +0300	[thread overview]
Message-ID: <YIaSSSTuns/okK9H@grain> (raw)
In-Reply-To: <d215d9fd4d03a01d60ea0ba740a023692178479c.1619365139.git.v.shpilevoy@tarantool.org>

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).

  parent reply	other threads:[~2021-04-26 10:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-25 15:42 Vladislav Shpilevoy via Tarantool-patches
2021-04-26  9:37 ` Serge Petrenko via Tarantool-patches
2021-04-26 10:13 ` Cyrill Gorcunov via Tarantool-patches [this message]
2021-04-26 21:03   ` Vladislav Shpilevoy via Tarantool-patches
2021-04-26 21:33     ` Cyrill Gorcunov via Tarantool-patches
2021-04-28 21:58 ` Vladislav Shpilevoy via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YIaSSSTuns/okK9H@grain \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 1/1] txn: destroy commit and rollback triggers' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox