From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp14.mail.ru (smtp14.mail.ru [94.100.181.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 45545469710 for ; Thu, 21 May 2020 17:12:58 +0300 (MSK) References: From: Vladislav Shpilevoy Message-ID: <7e71d3cd-1c50-c236-d222-95f13b24da5a@tarantool.org> Date: Thu, 21 May 2020 16:12:55 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH] vinyl: fix assert in vy_tx_write() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik , tarantool-patches@dev.tarantool.org 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?