From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Serge Petrenko <sergepetrenko@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH 1/2] memtx: add yields during space format check
Date: Tue, 4 Jun 2019 18:17:45 +0300 [thread overview]
Message-ID: <20190604151745.z5relioezjkyxhac@esperanza> (raw)
In-Reply-To: <c1d8dd242b2f5da84de40ffee1c8cc4a938703f4.1559576874.git.sergepetrenko@tarantool.org>
On Mon, Jun 03, 2019 at 06:51:05PM +0300, Serge Petrenko wrote:
> Just like index build, space check in memtx stalls event loop for the
> whole check time. Add occasional yields, and an on_replace trigger,
> which checks format for tuples inserted while space format check is in
> progress.
>
> Follow-up #3976
>
> @TarantoolBol document
> Title: memtx now checks space format in background
>
> There is no event loop stall when memtx engine checks space format
> anymore. You may insert tuples into a space, while its new format is
> being checked. If the tuples don't match the new format, format change
> will be aborted.
> ---
> src/box/memtx_space.c | 110 ++++++++++++++++++++++++++++++++----------
> 1 file changed, 84 insertions(+), 26 deletions(-)
>
> diff --git a/src/box/memtx_space.c b/src/box/memtx_space.c
> index 1d209033c..a370c038a 100644
> --- a/src/box/memtx_space.c
> +++ b/src/box/memtx_space.c
> @@ -43,6 +43,16 @@
> #include "column_mask.h"
> #include "sequence.h"
>
> +/*
> + * Yield every 1K tuples.
> + * In debug mode yield more often for testing purposes.
> + */
> +#ifdef NDEBUG
> +enum { MEMTX_YIELD_LOOPS = 1000 };
> +#else
> +enum { MEMTX_YIELD_LOOPS = 10 };
> +#endif
> +
> static void
> memtx_space_destroy(struct space *space)
> {
> @@ -814,6 +824,52 @@ memtx_space_add_primary_key(struct space *space)
> return 0;
> }
>
> +/*
> + * Ongoing index build or format check state used by
> + * corrseponding on_replace triggers.
> + */
> +struct memtx_op_state {
What's 'op'? The name's too generic. I renamed it to memtx_ddl_state.
I also renamed MEMTX_YIELD_LOOPS to MEMTX_DDL_YIELD_LOOPS to emphasize
that this is about DDL.
I pushed both patches to master with this minor changes. Thanks!
next prev parent reply other threads:[~2019-06-04 15:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-03 15:51 [PATCH 0/2] memtx: make space format check yield occasionally Serge Petrenko
2019-06-03 15:51 ` [PATCH 1/2] memtx: add yields during space format check Serge Petrenko
2019-06-03 15:54 ` [tarantool-patches] " Serge Petrenko
2019-06-04 15:17 ` Vladimir Davydov [this message]
2019-06-03 15:51 ` [PATCH 2/2] test: move vinyl space format test case to engine suite Serge Petrenko
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=20190604151745.z5relioezjkyxhac@esperanza \
--to=vdavydov.dev@gmail.com \
--cc=sergepetrenko@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='Re: [PATCH 1/2] memtx: add yields during space format check' \
/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