Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Stanislav Zudin <szudin@tarantool.org>
Cc: tarantool-patches@freelists.org, georgy@tarantool.org
Subject: Re: [tarantool-patches] [PATCH] ddl: No replication for temp and local spaces
Date: Fri, 21 Jun 2019 18:05:11 +0300	[thread overview]
Message-ID: <20190621150510.3besc43w55tnmkac@esperanza> (raw)
In-Reply-To: <067138d7-a71d-dc15-1ebc-0d2d9f3bab8a@tarantool.org>

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 <szudin@tarantool.org>
> 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.

  reply	other threads:[~2019-06-21 15:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 12:48 Stanislav Zudin
2019-06-20  9:00 ` [tarantool-patches] " Konstantin Osipov
2019-06-20  9:02   ` Konstantin Osipov
2019-06-20 10:35     ` Георгий Кириченко
2019-06-20 10:34   ` Георгий Кириченко
2019-06-20 11:25 ` [tarantool-patches] " Vladimir Davydov
2019-06-20 13:33   ` Stanislav Zudin
2019-06-21 15:05     ` Vladimir Davydov [this message]
2019-06-25  9:01       ` Stanislav Zudin
2019-06-25 12:56         ` 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=20190621150510.3besc43w55tnmkac@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=georgy@tarantool.org \
    --cc=szudin@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH] ddl: No replication for temp and local spaces' \
    /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