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 8A96E2557E for ; Tue, 30 Jul 2019 13:57:03 -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 mG4omhcyiBY3 for ; Tue, 30 Jul 2019 13:57:03 -0400 (EDT) Received: from smtp31.i.mail.ru (smtp31.i.mail.ru [94.100.177.91]) (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 4B4F325575 for ; Tue, 30 Jul 2019 13:57:03 -0400 (EDT) Received: by smtp31.i.mail.ru with esmtpa (envelope-from ) id 1hsWMv-0000eP-Eo for tarantool-patches@freelists.org; Tue, 30 Jul 2019 20:57:01 +0300 Date: Tue, 30 Jul 2019 20:57:01 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH v2] alter: fix rollback in case DDL and DML are used in the same transaction Message-ID: <20190730175701.GD24376@atlas> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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/07/30 20:33]: > A txn_stmt keeps a reference to the space it modifies. Memtx uses this > space reference to revert the statement on error or voluntary rollback > so the space must stay valid throughout the whole transaction. > > The problem is a DML statement may be followed by a DDL statement that > modifies the target space in the same transaction. If we try to roll > it back before running the rollback triggers installed by the DDL > statement, it will access an invalid space object (e.g. missing an > index), which will result in a crash. > > To fix this problem, let's run triggers installed by a statement right > after rolling back the statement. > > Closes #4368 LGTM. The final fix could actually be to make Lua commit/rollback triggers append to statemenet list, not transaction list, and delete transaction list altogether. -- Konstantin Osipov, Moscow, Russia