From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 15 Jul 2019 18:05:48 +0300 From: Konstantin Osipov Subject: Re: [PATCH v2 2/3] ddl: don't use space_index from AlterSpaceOp::commit,rollback Message-ID: <20190715150548.GB16877@atlas> References: <32e42602f21a0b40394e915f013b837cea35ce6f.1562763283.git.vdavydov.dev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <32e42602f21a0b40394e915f013b837cea35ce6f.1562763283.git.vdavydov.dev@gmail.com> To: Vladimir Davydov Cc: tarantool-patches@freelists.org List-ID: * Vladimir Davydov [19/07/10 16:13]: > If there are multiple DDL operations in the same transactions, which is > impossible now, but will be implemented soon, AlterSpaceOp::commit and > rollback methods must not access space index map. To understand that, > consider the following example: > > - on_replace: AlterSpaceOp1 creates index I1 for space S1 > - on_replace: AlterSpaceOp2 moves index I1 from space S1 to space S2 > - on_commit: AlterSpaceOp1 commits creation of index I1 > > AlterSpaceOp1 can't lookup I1 in S1 by id, because the index was moved > from S1 to S2 by AlterSpaceOp2. If AlterSpaceOp1 attempts to look it up, > it will access a wrong index. > > Fix that by storing pointers to old and new indexes in AlterSpaceOp if > required. Please make this comment more clear. LGTM. -- Konstantin Osipov, Moscow, Russia