[tarantool-patches] Re: [PATCH 3/4] txn: use savepoints to roll back statements on yield or error

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


On Thu, Jul 25, 2019 at 02:19:51AM +0300, Konstantin Osipov wrote:
> * Konstantin Osipov <kostja at tarantool.org> [19/07/25 01:59]:
> > * Vladimir Davydov <vdavydov.dev at gmail.com> [19/07/19 21:09]:
> > > Currently, txn_savepoint objects are only used for savepoints created by
> > > the user while internally we use stailq_entry instead. This is okay now,
> > > because txn_savepoint is equivalent to a stailq_entry in most cases, but
> > > in order to properly deal with commit/rollback triggers, we will need to
> > > maintain extra information in each savepoint. So this patch makes txn
> > > use txn_savepoint for internal needs.
> > > 
> > > Note that this patch increases txn::sub_stmt_begin array size by 1,
> > > because we could actually write beyond the array bounds - it didn't
> > > lead to any problems before, because it only overwrote txn::signature.
> > > With the increased array entry size, it can overwrite more vital parts
> > > of the txn struct.
> > 
> > Please add a fix for txn->signature overwrite to 1.10 in a separate patch,
> > this part is LGTM.
> 
> As to other parts, I don't understand the commit comment to begin
> with.
> 
> Can there be a DDL in a sub-statement?

Yes, there's nothing that prevents one from doing that.

Besides, one can install on_commit/on_rollback triggers from Lua.

> What is the point of having a full blown savepoint for sub-statement
> boundaries?

To remove/run on_commit/on_rollback triggers in txn_rollback_stmt.



More information about the Tarantool-patches mailing list