From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 21 Jun 2019 18:05:11 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] [PATCH] ddl: No replication for temp and local spaces Message-ID: <20190621150510.3besc43w55tnmkac@esperanza> References: <20190619124823.7021-1-szudin@tarantool.org> <20190620112550.v2mwqa4orlr4y3rj@esperanza> <067138d7-a71d-dc15-1ebc-0d2d9f3bab8a@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <067138d7-a71d-dc15-1ebc-0d2d9f3bab8a@tarantool.org> To: Stanislav Zudin Cc: tarantool-patches@freelists.org, georgy@tarantool.org List-ID: On Thu, Jun 20, 2019 at 04:33:26PM +0300, Stanislav Zudin wrote: > From b596d7d9cda4649a3c0ebb27d4887a57422ac458 Mon Sep 17 00:00:00 2001 > From: Stanislav Zudin > Date: Wed, 19 Jun 2019 12:28:02 +0300 > Subject: [PATCH] ddl: No replication for temp and local spaces > > Do not spread the space:truncate() to replicas if the > affected space is local or temporary. > > Closes #4263 > --- > Branch: https://github.com/tarantool/tarantool/tree/stanztt/gh-4263-no-replica-tmplocal-space > Issue: https://github.com/tarantool/tarantool/issues/4263 > > src/box/alter.cc | 10 ++++ > test/replication/local_spaces.result | 78 ++++++++++++++++++++++++++ > test/replication/local_spaces.test.lua | 36 ++++++++++++ > 3 files changed, 124 insertions(+) > > diff --git a/src/box/alter.cc b/src/box/alter.cc > index a37a68ce4..e8a49cf98 100644 > --- a/src/box/alter.cc > +++ b/src/box/alter.cc > @@ -2278,6 +2278,16 @@ on_replace_dd_truncate(struct trigger * /* trigger > */, void *event) > auto scoped_guard = > make_scoped_guard([=] { alter_space_delete(alter); }); > > + /* > + * Modify the WAL header to prohibit > + * replication of local & temporary > + * spaces truncation. > + */ > + if (space_is_temporary(old_space) || > + space_group_id(old_space) == GROUP_LOCAL) { > + stmt->row->group_id = GROUP_LOCAL; > + } > + > /* > * Recreate all indexes of the truncated space. > */ > diff --git a/test/replication/local_spaces.result > b/test/replication/local_spaces.result > index ed1b76da8..97e9a9814 100644 > --- a/test/replication/local_spaces.result > +++ b/test/replication/local_spaces.result > @@ -71,6 +71,22 @@ s3.temporary > --- > - true > ... > +-- gh-4263 The truncation of the local & temporary space > +-- should not spread among the replicas > +s4 = box.schema.space.create('test4', {is_local = true, temporary = true}) You should test 'is_local' and 'tmemporary' separately now, as you changed the condition in on_replace_dd_truncate. Please fix.