[tarantool-patches] Re: [PATCH 2/4] txn: reverse commit trigger list only before running commit triggers

Vladimir Davydov vdavydov.dev at gmail.com
Thu Jul 25 12:35:28 MSK 2019


On Thu, Jul 25, 2019 at 12:29:48PM +0300, Konstantin Osipov wrote:
> * Vladimir Davydov <vdavydov.dev at gmail.com> [19/07/25 12:28]:
> > On Thu, Jul 25, 2019 at 01:48:11AM +0300, Konstantin Osipov wrote:
> > > * Vladimir Davydov <vdavydov.dev at gmail.com> [19/07/19 21:09]:
> > > > Commit triggers must be run in the same order they are added, see commit
> > > > 013432641283 ("txn: fix execution order of commit triggers"). To achieve
> > > > that we added a new trigger method, trigger_add_tail(), which adds new
> > > > triggers to the trigger list tail rather than to the head, and now we
> > > > use this new method for adding commit triggers.
> > > 
> > > Commit triggers are a hot path.
> > 
> > I wouldn't say they are - they are only used by DDL.
> 
> commit path is always a hot path, and if the server itself invokes
> these triggers on DDL only, it doesn't mean users never invoke
> them on a hot path.
> 
> But the server itself will use a lot of commit triggers when
> materialized views are implemented.

Reversing a list of a few triggers won't make much difference from
perfromance pov IMO as we iterate over them anyway. Iterating over
the list in the reverse order would require a bit of refactoring and
adding rlist_foreach_entry_reverse_safe method. I don't really care,
to tell the truth, and will rework as you wish, no problem.



More information about the Tarantool-patches mailing list