[tarantool-patches] [PATCH 3/4] vinyl: abort affected transactions when space is removed from cache
Vladimir Davydov
vdavydov.dev at gmail.com
Mon Mar 25 11:21:07 MSK 2019
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.
More information about the Tarantool-patches
mailing list