From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 6 Apr 2018 17:28:47 +0300 From: Konstantin Osipov Subject: Re: [PATCH v2 2/2] alter: zap space_vtab::commit_alter Message-ID: <20180406142847.GA13233@atlas> References: <20180406141001.GE18946@atlas> <20180406142339.3vzwcwv7z7ttdibu@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180406142339.3vzwcwv7z7ttdibu@esperanza> To: Vladimir Davydov Cc: tarantool-patches@freelists.org List-ID: * Vladimir Davydov [18/04/06 17:25]: > On Fri, Apr 06, 2018 at 05:10:01PM +0300, Konstantin Osipov wrote: > > * Vladimir Davydov [18/04/06 16:20]: > > > > > space_vtab::commit_alter is implemented only by memtx, which uses it > > > to set bsize for a new space. However, it isn't necessary to use > > > commit_alter for this - instead we can set bsize in prepare_alter and > > > reset it in drop_primary_key, along with memtx_space::replace. Let's > > > do it and zap space_vtab::commit_alter altogether, because the callback > > > is confusing: judging by its name it should be called after WAL write, > > > but it is called before. > > > void > > > DropIndex::alter(struct alter_space *alter) > > > { > > > - space_drop_primary_key(alter->new_space); > > > + if (old_index_def->iid == 0) > > > + space_drop_primary_key(alter->new_space); > > > } > > > > I keep wondering why you ditched a nice comment. > > If you think it was bad, please write a better one. > > This comment is only pertinent to memtx so I just moved it to > memtx_space_drop_primary_key. > > > - /* > > > - * If it's not the primary key, nothing to do -- > > > - * the dropped index didn't exist in the new space > > > - * definition, so does not exist in the created space. > > > - */ What about this hunk? Anyway, it's not self-explanatory. Why aren't we doing anything here for the secondary index and have to take an extra step for primary? This is not obvious. > > a new good comment. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov