[tarantool-patches] [PATCH 3/4] vinyl: abort affected transactions when space is removed from cache
Георгий Кириченко
georgy at tarantool.org
Mon Mar 25 12:03:49 MSK 2019
On Monday, March 25, 2019 11:21:07 AM MSK Vladimir Davydov wrote:
> 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.
Sorry, it was my mistake
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20190325/abeb2347/attachment.sig>
More information about the Tarantool-patches
mailing list