[tarantool-patches] Re: [PATCH 3/3] alter: fix rollback in case DDL and DML are used in the same transaction

Vladimir Davydov vdavydov.dev at gmail.com
Thu Jul 25 11:51:17 MSK 2019


On Thu, Jul 25, 2019 at 01:32:55AM +0300, Konstantin Osipov wrote:
> * Vladimir Davydov <vdavydov.dev at gmail.com> [19/07/23 18:49]:
> > 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 DML statements may be mixed in a DDL transaction, in
> > which case we always roll back DML statements first and only then run
> > rollback triggers to revert changes done to the schema by the DDL
> > statements. This means every DDL statement modifying the space cache
> > must be implemented in such a way that it leaves both the old space
> > and the new space valid until commit or rollback.
> 
> How are we going to enforce this invariant by code structure going
> forward other than patching it hastily when it breaks?

No way, I guess. We'll need to rethink the whole ALTER infrastructure
if things go south. Just like we always do.



More information about the Tarantool-patches mailing list