From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id D7CBD2E2A8 for ; Sat, 25 May 2019 02:15:38 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id t9FNGBzIA3Gr for ; Sat, 25 May 2019 02:15:38 -0400 (EDT) Received: from smtp34.i.mail.ru (smtp34.i.mail.ru [94.100.177.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 87F1230250 for ; Sat, 25 May 2019 02:15:38 -0400 (EDT) Received: by smtp34.i.mail.ru with esmtpa (envelope-from ) id 1hUPxx-00049B-7v for tarantool-patches@freelists.org; Sat, 25 May 2019 09:15:37 +0300 Date: Sat, 25 May 2019 09:15:36 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 3/3] vinyl: fix deferred DELETE statement lost on commit Message-ID: <20190525061536.GD14501@atlas> References: <98cf1219a6d9c8f53098c642e9ffaa5280a03805.1558733444.git.vdavydov.dev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <98cf1219a6d9c8f53098c642e9ffaa5280a03805.1558733444.git.vdavydov.dev@gmail.com> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org * Vladimir Davydov [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