Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	tarantool-patches@dev.tarantool.org, gorcunov@gmail.com
Subject: Re: [Tarantool-patches] [PATCH v2 1/1] txn: destroy commit and rollback triggers
Date: Mon, 26 Apr 2021 12:37:50 +0300	[thread overview]
Message-ID: <94d0fd7b-3e3f-c86a-f264-d7113ec5c71b@tarantool.org> (raw)
In-Reply-To: <d215d9fd4d03a01d60ea0ba740a023692178479c.1619365139.git.v.shpilevoy@tarantool.org>



25.04.2021 18:42, Vladislav Shpilevoy пишет:
> They were not deleted ever. Worked fine for DDL and replication,
> for which they were introduced in the first place, because these
> triggers are on the region memory.
>
> But didn't work when the triggers became available in the public
> API, because these are allocated on the heap. As a result, all the
> box.on_commit() and box.on_rollback() triggers leaked.
>
> The patch ensures all the on_commit/on_rollback triggers are
> destroyed.
>
> The statement triggers on_commit/on_rollback are left intact since
> they are private and never need deletion, but the patch adds
> assertions in case they ever would need to be destroyed.
>
> Another option was to force all the commit and rollback triggers
> clear themselves. For example, in case of commit all the on_commit
> triggers must clear themselves, and the rollback triggers are
> destroyed. Vice versa when a rollback happens. This would allow
> not to manually destroy on_commit triggers in case of commit. But
> it didn't work because the Lua triggers all work via a common
> runner lbox_trigger_run(), which can't destroy its argument in
> most of the cases (space:on_replace, :before_replace, ...). It
> could be patched but requires to add some work to the Lua triggers
> affecting all of them, which in total might be not better.
>
> Closes #6025
> ---
> Changes in v2:
> - Fixed a bug about txn rollback triggers called at statement
>    rollback, added a test;
> - Removed attempts to destroy and clear statement triggers;
>
> Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-6025-box.on_commit-leak
> Issue: https://github.com/tarantool/tarantool/issues/6025
>

Hi! Thanks for the fixes! LGTM.

-- 
Serge Petrenko


  reply	other threads:[~2021-04-26  9:37 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 [this message]
2021-04-26 10:13 ` Cyrill Gorcunov via Tarantool-patches
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=94d0fd7b-3e3f-c86a-f264-d7113ec5c71b@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 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