Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Konstantin Osipov <kostja@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH v2 1/2] memtx: do not use space_vtab::commit_alter for freeing tuples
Date: Fri, 6 Apr 2018 17:19:26 +0300	[thread overview]
Message-ID: <20180406141926.a47vc576bjnayph6@esperanza> (raw)
In-Reply-To: <20180406140827.GD18946@atlas>

On Fri, Apr 06, 2018 at 05:08:27PM +0300, Konstantin Osipov wrote:
> * Vladimir Davydov <vdavydov.dev@gmail.com> [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.

No problem, I will keep the old name.

> 
> > 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.

This method is used for rebuilding primary keys as well as secondary.
Yeah, this is confusing as hell. I have a patch renaming it and I'm
planning to submit it soon (it's a part of my ALTER rework).

> 
> Other than these two comments, the patch is OK to push.

  reply	other threads:[~2018-04-06 14:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-06 13:15 [PATCH v2 0/2] alter: fix WAL error handling Vladimir Davydov
2018-04-06 13:15 ` [PATCH v2 1/2] memtx: do not use space_vtab::commit_alter for freeing tuples Vladimir Davydov
2018-04-06 14:08   ` Konstantin Osipov
2018-04-06 14:19     ` Vladimir Davydov [this message]
2018-04-06 15:29       ` Vladimir Davydov
2018-04-06 13:15 ` [PATCH v2 2/2] alter: zap space_vtab::commit_alter Vladimir Davydov
2018-04-06 14:10   ` Konstantin Osipov
2018-04-06 14:23     ` Vladimir Davydov
2018-04-06 14:28       ` Konstantin Osipov
2018-04-06 15:25         ` Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180406141926.a47vc576bjnayph6@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH v2 1/2] memtx: do not use space_vtab::commit_alter for freeing tuples' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox