[Tarantool-patches] [PATCH] vinyl: fix assert in vy_tx_write()

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu May 21 17:12:55 MSK 2020


Hi! Thanks for the patch!

On 21/05/2020 03:15, Nikita Pettik wrote:
> Assert in vy_tx_write() validates that upsert applied on the top of
> cached statement is always replace. In fact, it is not always so. If
> vy_apply_upsert() fails due to the fact that PK is modified, it returns
> old statement (i.e. statement which upsert is applied on). In this
> regard, if tuple cache contains insert and invalid upsert is executed,
> vy_apply_upsert() will return insert. As a result, assert will fire.
> Let's fix it and take into account that vy_apply_upsert() is able to
> return inserts as well.

I looked at other places in vinyl, which apply an upsert, and found
vy_lsm_commit_upsert() in vy_lsm.c:1018. The result is also always
assumed to be REPLACE. Is it correct?


More information about the Tarantool-patches mailing list