[tarantool-patches] Re: [PATCH 3/3] vinyl: fix deferred DELETE statement lost on commit

Konstantin Osipov kostja at tarantool.org
Sat May 25 09:15:36 MSK 2019


* Vladimir Davydov <vdavydov.dev at gmail.com> [19/05/25 06:41]:
> Even if a statement isn't marked as VY_STMT_DEFERRED_DELETE, e.g. it's
> a REPLACE produced by an UPDATE request, it may overwrite a statement in
> the transaction write set that is marked so, for instance:
> 
>   s = box.schema.space.create('test', {engine = 'vinyl'})
>   pk = s:create_index('pk')
>   sk = s:create_index('sk', {parts = {2, 'unsigned'}})
> 
>   s:insert{1, 1}
> 
>   box.begin()
>   s:replace{1, 2}
>   s:update(1, {{'=', 2, 3}})
>   box.commit()
> 
> If we don't mark REPLACE{3,1} produced by the update operatoin with
> VY_STMT_DEFERRED_DELETE flag, we will never generate a DELETE statement
> for INSERT{1,1}. That is, we must inherit the flag from the overwritten
> statement when we insert a new one into a write set.
> 
> Closes #4248

this one is also lgtm.

apparently when looking at deferred delete we completely missed
the multi-statement-transactions complications. 

Maybe produce a randomized test which would create long/diverse
trnasactions with deferred delete and check correctness of the
outcome?


-- 
Konstantin Osipov, Moscow, Russia




More information about the Tarantool-patches mailing list