[tarantool-patches] Re: [PATCH v2] alter: fix rollback in case DDL and DML are used in the same transaction
Konstantin Osipov
kostja at tarantool.org
Tue Jul 30 20:57:01 MSK 2019
* Vladimir Davydov <vdavydov.dev at gmail.com> [19/07/30 20:33]:
> A txn_stmt keeps a reference to the space it modifies. Memtx uses this
> space reference to revert the statement on error or voluntary rollback
> so the space must stay valid throughout the whole transaction.
>
> The problem is a DML statement may be followed by a DDL statement that
> modifies the target space in the same transaction. If we try to roll
> it back before running the rollback triggers installed by the DDL
> statement, it will access an invalid space object (e.g. missing an
> index), which will result in a crash.
>
> To fix this problem, let's run triggers installed by a statement right
> after rolling back the statement.
>
> Closes #4368
LGTM.
The final fix could actually be to make Lua commit/rollback
triggers append to statemenet list, not transaction list, and
delete transaction list altogether.
--
Konstantin Osipov, Moscow, Russia
More information about the Tarantool-patches
mailing list