From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 6 Apr 2018 17:08:27 +0300 From: Konstantin Osipov Subject: Re: [PATCH v2 1/2] memtx: do not use space_vtab::commit_alter for freeing tuples Message-ID: <20180406140827.GD18946@atlas> References: <92f5581b8d5b981abb14d29e411b03fad02e2607.1523019950.git.vdavydov.dev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <92f5581b8d5b981abb14d29e411b03fad02e2607.1523019950.git.vdavydov.dev@gmail.com> To: Vladimir Davydov Cc: tarantool-patches@freelists.org List-ID: * Vladimir Davydov [18/04/06 16:20]: > + > +static void > +memtx_index_free_tuples(struct index *index) > +{ > -static void > -memtx_space_prune(struct space *space) I liked the old term (prune) more (memtx_index_prune()). Please consider keeping it. > index ec6f6db6..ebb54f05 100644 > --- a/src/box/memtx_space.c > +++ b/src/box/memtx_space.c > @@ -803,41 +803,17 @@ memtx_space_build_secondary_key(struct space *old_space, > break; > assert(old_tuple == NULL); /* Guaranteed by DUP_INSERT. */ > (void) old_tuple; > + /* > + * All tuples stored in a memtx space must be > + * referenced by the primary index. > + */ > + if (new_index->def->iid == 0) > + tuple_ref(tuple); I don't understand this change. This method builds a secondary key. /** * Called with the new empty secondary index. * Fill the new index with data from the primary * key of the space. */ How is that possible that new_index->def->iid is 0 here? If you're re-using this static function, then please rename it. Other than these two comments, the patch is OK to push. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov