Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Serge Petrenko <sergepetrenko@tarantool.org>,
	tarantool-patches@dev.tarantool.org, gorcunov@gmail.com
Subject: Re: [Tarantool-patches] [PATCH 1/1] txn: destroy commit and rollback triggers
Date: Sun, 25 Apr 2021 17:47:27 +0200	[thread overview]
Message-ID: <74b6725d-c087-bba4-d970-2ceae0ba95ce@tarantool.org> (raw)
In-Reply-To: <fa9828e4-c3c0-a725-e08d-4f9dbf2fb30c@tarantool.org>

Hi! Thanks for the review!

>> diff --git a/src/box/txn.c b/src/box/txn.c
>> index 03b39e0de..4dfe1ad82 100644
>> --- a/src/box/txn.c
>> +++ b/src/box/txn.c
>> @@ -150,7 +150,7 @@ 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);
>> +        txn_run_rollback_triggers(txn);
>>   }
> 
> 
> 1. This piece ran stmt->on_rollback, and you run txn->on_rollback now.
>    These are not the same, for example check txn_rollback_to_svp below.

Indeed, I added a bug here, thanks for noticing. In v2 I removed
these run_rollback/run_commit functions. For the statement triggers
I added an assertion that they don't have a 'destroy' method. Because
if they would have, on commit we would need to walk the statement
list and for each statement destroy its rollback triggers, which would
add notable complexity.

>> diff --git a/src/box/vinyl.c b/src/box/vinyl.c
>> index b53e97593..d381179d0 100644
>> --- a/src/box/vinyl.c
>> +++ b/src/box/vinyl.c
> ...
> 
> 
> 2. There's also applier_txn_rollback_cb() in applier.cc
>    You should probably  clear it as  well.

In v2 I deleted all trigger clears.

>> diff --git a/test/app-tap/gh-6025-box.on_commit-leak.test.lua b/test/app-tap/gh-6025-box.on_commit-leak.test.lua
>> new file mode 100755
>> index 000000000..ec4e8b099
>> --- /dev/null
>> +++ b/test/app-tap/gh-6025-box.on_commit-leak.test.lua
> 
> 3. The test's cool, I wouldn't have come up with it myself.
>    Shouldn't it be in box-tap though?

Yes, this is about box, and I didn't think of box-tap. Moved there now.

I've sent v2 since the patch is too different now and the diff would
look not very easy to understand.

      reply	other threads:[~2021-04-25 15:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-24  0:29 Vladislav Shpilevoy via Tarantool-patches
2021-04-25  8:44 ` Serge Petrenko via Tarantool-patches
2021-04-25 15:47   ` Vladislav Shpilevoy via Tarantool-patches [this message]

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=74b6725d-c087-bba4-d970-2ceae0ba95ce@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=sergepetrenko@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 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