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 E078C24F12 for ; Wed, 24 Jul 2019 18:32:57 -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 J7vk8UyROetJ for ; Wed, 24 Jul 2019 18:32:57 -0400 (EDT) Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [94.100.177.106]) (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 A09C324844 for ; Wed, 24 Jul 2019 18:32:57 -0400 (EDT) Received: by smtp46.i.mail.ru with esmtpa (envelope-from ) id 1hqPoe-0006ly-9j for tarantool-patches@freelists.org; Thu, 25 Jul 2019 01:32:56 +0300 Date: Thu, 25 Jul 2019 01:32:55 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 3/3] alter: fix rollback in case DDL and DML are used in the same transaction Message-ID: <20190724223255.GC13150@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/23 18:49]: > 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 DML statements may be mixed in a DDL transaction, in > which case we always roll back DML statements first and only then run > rollback triggers to revert changes done to the schema by the DDL > statements. This means every DDL statement modifying the space cache > must be implemented in such a way that it leaves both the old space > and the new space valid until commit or rollback. How are we going to enforce this invariant by code structure going forward other than patching it hastily when it breaks? -- Konstantin Osipov, Moscow, Russia