From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 19 Jul 2019 22:42:04 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] [PATCH 4/4] txn: undo commit/rollback triggers when reverting to savepoint Message-ID: <20190719194204.vpsjowi6klv77ifg@esperanza> References: <4ec767f8-ebf2-07ec-84c8-519e11aa5176@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ec767f8-ebf2-07ec-84c8-519e11aa5176@tarantool.org> To: Vladislav Shpilevoy Cc: tarantool-patches@freelists.org List-ID: On Fri, Jul 19, 2019 at 09:36:08PM +0200, Vladislav Shpilevoy wrote: > > > On 19/07/2019 20:08, Vladimir Davydov wrote: > > When reverting to a savepoint inside a DDL transaction, apart from > > undoing changes done by the DDL statements to the system spaces, we also > > have to > > > > - Run rollback triggers installed after the savepoint was set, because > > otherwise changes done to the schema by DDL won't be undone. > > - Remove commit triggers installed after the savepoint, because they > > are not relevant anymore, apparently. > > > > To achieve that, let's remember not only the last transaction statement > > at the time when a savepoint is created, but also the state of commit > > and rollback triggers. Since in contrast to txn statements, commit and > > rollback triggers can actually be deleted from the list, we create dummy > > triggers per each savepoint and use them as markers in the trigger > > lists. We don't however create dummy triggers if no commit/rollback > > triggers is installed, because in that case we would simply need to > > clear the trigger lists. > > > > While we are at it, let's also make sure that a rollback trigger doesn't > > an already freed tuple. To do that, we release statement tuples after > > Nit: 'rollback trigger doesn't an already freed'. Perhaps I am wrong, > but shouldn't be here a verb after 'doesn't'? Yep, I missed word 'access'. Fixed. Thanks.