Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH v2 5/7] Introduce _vinyl_deferred_delete system space
Date: Tue, 21 Aug 2018 18:42:52 +0300	[thread overview]
Message-ID: <20180821154252.GE28159@chai> (raw)
In-Reply-To: <2af0dbcdd1daeffac95fa7d23a86efeec3990dd7.1534847663.git.vdavydov.dev@gmail.com>

* Vladimir Davydov <vdavydov.dev@gmail.com> [18/08/21 15:19]:
> +	/*
> +	 * _vinyl_deferred_delete - blackhole that is needed
> +	 * for writing deferred DELETE statements generated by
> +	 * vinyl compaction tasks to WAL.
> +	 */

Please expand this comment to explain why we can't create this
space purely from Lua or upgrade script: 

There is an intricate ordering dependency between creating of this
system space, recovery, and engine initialization, when we set an
on_replace trigger on the space. To resolve this dependency, we
create a space stub at schema_init(), then set a trigger in
engine_init(), which is called next, and then "alter" the space to
its final form in recovery(), which is called next.

> +	{
> +		const char *engine = "blackhole";
> +		const char *name = "_vinyl_deferred_delete";
> +		struct space_opts opts = space_opts_default;
> +		opts.group_id = GROUP_LOCAL;
> +		struct space_def *def;
> +		def = space_def_new_xc(BOX_VINYL_DEFERRED_DELETE_ID, ADMIN, 0,
> +				       name, strlen(name), engine,
> +				       strlen(engine), &opts, NULL, 0);
> +		auto def_guard = make_scoped_guard([=] {
> +			space_def_delete(def);
> +		});
> +		RLIST_HEAD(key_list);
> +		struct space *space = space_new_xc(def, &key_list);
> +		space_cache_replace(space);
> +		init_system_space(space);
> +		trigger_run_xc(&on_alter_space, space);
> +	}
>  }
>  

Otherwise OK to push.

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

  reply	other threads:[~2018-08-21 15:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-21 11:15 [PATCH v2 0/7] vinyl: eliminate disk read on REPLACE/DELETE Vladimir Davydov
2018-08-21 11:15 ` [PATCH v2 1/7] vinyl: do not store meta in secondary index runs Vladimir Davydov
2018-08-21 15:08   ` Konstantin Osipov
2018-08-21 11:15 ` [PATCH v2 2/7] vinyl: teach write iterator to return overwritten tuples Vladimir Davydov
2018-08-21 15:14   ` Konstantin Osipov
2018-08-21 15:37     ` Vladimir Davydov
2018-08-21 11:15 ` [PATCH v2 3/7] vinyl: prepare write iterator heap comparator for deferred DELETEs Vladimir Davydov
2018-08-21 15:38   ` Konstantin Osipov
2018-08-21 11:15 ` [PATCH v2 4/7] vinyl: allow to skip certain statements on read Vladimir Davydov
2018-08-21 15:39   ` Konstantin Osipov
2018-08-21 11:15 ` [PATCH v2 5/7] Introduce _vinyl_deferred_delete system space Vladimir Davydov
2018-08-21 15:42   ` Konstantin Osipov [this message]
2018-08-22 17:04     ` Vladimir Davydov
2018-08-21 11:15 ` [PATCH v2 6/7] vinyl: zap vy_mem::min_lsn and rename max_lsn to dump_lsn Vladimir Davydov
2018-08-21 15:44   ` Konstantin Osipov
2018-08-22 13:00   ` Vladimir Davydov
2018-08-21 11:15 ` [PATCH v2 7/7] vinyl: eliminate disk read on REPLACE/DELETE Vladimir Davydov
2018-08-21 16:13   ` Konstantin Osipov
2018-08-22 17:08     ` Vladimir Davydov
2018-08-22 17:50 ` [PATCH v2 0/7] " 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=20180821154252.GE28159@chai \
    --to=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH v2 5/7] Introduce _vinyl_deferred_delete system space' \
    /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