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: [tarantool-patches] Re: [PATCH 1/3] vinyl: use update_def index method to update vy_lsm on ddl
Date: Thu, 25 Jul 2019 11:38:17 +0300	[thread overview]
Message-ID: <20190725083817.GD24631@esperanza> (raw)
In-Reply-To: <20190724222500.GA13150@atlas>

On Thu, Jul 25, 2019 at 01:25:01AM +0300, Konstantin Osipov wrote:
> * Vladimir Davydov <vdavydov.dev@gmail.com> [19/07/23 18:49]:
> > When an index definition is modified by DDL in such a way that doesn't
> > require index rebuild (e.g. a key part type is changed from unsigned to
> > integer), we move the index from the old space container to the new one,
> > see ModifyIndex. In case of Vinyl we also need to update key definitions
> > and options stored in vy_lsm. We do that in swap_index space method, but
> > this isn't entirely correct, as this method is also called when an index
> > is moved without any modifications, see MoveIndex. Let's do this from
> > update_def index method instead, which seems to be more suitable.
> > 
> > The only reason this code lives in swap_index space method now is that
> > we didn't have update_def index method when this functionality was
> > introduced in the first place.
> 
> First of all, it is extremely annoying that instead of testing
> this properly despite my humble, repeated requests we waited for
> these bugs to surface and now address them with urgent
> patches.

Well, that's how things typically go. We write code, we find bugs, we
fix them. It's impossible to write bug-free code. Tests can reduce the
possibility of a bug, but they aren't a silver bullet, especially when
written by a developer whose goal is to commit a feature ;)

Regarding this particular bug, to tell you the truth, I knew it existed
when I submitted the original patch (it was me who filed the ticket
after all), but I also knew that it could be fixed without redesign so
I proceeded with commit ;)

I often deliberately commit buggy code, because it's easier to proceed
knowing that the design is agreed upon and committed, easier to build
on top of that.

> 
> I see if I could find anything wrong with this patch but I can't.
> 
> > +static struct key_def *
> > +key_def_do_copy(struct key_def *res, const struct key_def *src, size_t sz)
> 
> I personally prefer _impl to do_.

NP, will rename if you like.

  reply	other threads:[~2019-07-25  8:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 15:49 [PATCH 0/3] Fix crash on rollback of mixed DML/DDL transaction Vladimir Davydov
2019-07-23 15:49 ` [PATCH 1/3] vinyl: use update_def index method to update vy_lsm on ddl Vladimir Davydov
2019-07-24 22:25   ` [tarantool-patches] " Konstantin Osipov
2019-07-25  8:38     ` Vladimir Davydov [this message]
2019-07-25 12:11   ` Vladimir Davydov
2019-07-23 15:49 ` [PATCH 2/3] vinyl: move unique check optimization setup to the space level Vladimir Davydov
2019-07-24 22:31   ` [tarantool-patches] " Konstantin Osipov
2019-07-25  8:46     ` Vladimir Davydov
2019-07-25 12:11   ` Vladimir Davydov
2019-07-23 15:49 ` [PATCH 3/3] alter: fix rollback in case DDL and DML are used in the same transaction Vladimir Davydov
2019-07-24 22:32   ` [tarantool-patches] " Konstantin Osipov
2019-07-25  8:51     ` Vladimir Davydov
2019-07-30 10:56       ` Vladimir Davydov
2019-07-30 12:14         ` Konstantin Osipov

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=20190725083817.GD24631@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] Re: [PATCH 1/3] vinyl: use update_def index method to update vy_lsm on ddl' \
    /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