From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 25 Mar 2019 11:21:07 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] [PATCH 3/4] vinyl: abort affected transactions when space is removed from cache Message-ID: <20190325082107.ihfoj2lx7ex2rvkj@esperanza> References: <4522466.B0yFr5P2XB@home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4522466.B0yFr5P2XB@home.lan> To: =?utf-8?B?0JPQtdC+0YDQs9C40Lkg0JrQuNGA0LjRh9C10L3QutC+?= Cc: tarantool-patches@freelists.org, kostja@tarantool.org List-ID: On Mon, Mar 25, 2019 at 08:45:41AM +0300, Георгий Кириченко wrote: > > +static void > > +vinyl_space_invalidate(struct space *space) > > +{ > > + struct vy_env *env = vy_env(space->engine); > > + /* > > + * Abort all transactions involving the invalidated space. > > + * An aborted transaction doesn't allow any DML/DQL requests > > + * so the space won't be used anymore and can be safely > > + * destroyed. > > + * > > + * There's a subtle corner case though - a transaction can > > + * be reading disk from a DML request right now, with this > > + * space passed to it in the argument list. However, it's > > + * handled as well: the iterator will return an error as > > + * soon as it's done reading disk, which will make the DML > > + * request bail out early, without dereferencing the space. > > + */ > > + tx_manager_abort_writers_for_ddl(env->xm, space); > > As tx_manager_abort_writers_for_ddl ignores applier sessions it wouldn't fix > the issue. I think a separate function should be introduced. Wrong. It's tx_manager_abort_writers_for_ro that treats appliers in a special way; tx_manager_abort_writers_for_ddl aborts all transactions involving the given space, irrespective of the session type.