From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 25 Jul 2019 12:28:36 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] Re: [PATCH 3/4] txn: use savepoints to roll back statements on yield or error Message-ID: <20190725092836.GI24631@esperanza> References: <20190724225505.GC14292@atlas> <20190724231951.GF15185@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190724231951.GF15185@atlas> To: Konstantin Osipov Cc: tarantool-patches@freelists.org List-ID: On Thu, Jul 25, 2019 at 02:19:51AM +0300, Konstantin Osipov wrote: > * Konstantin Osipov [19/07/25 01:59]: > > * Vladimir Davydov [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.