Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: Konstantin Osipov <kostja.osipov@gmail.com>,
	tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org,
	alyapunov@tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] vinyl: rotate mem during index build on demand
Date: Thu, 4 Jun 2020 22:32:05 +0000	[thread overview]
Message-ID: <20200604223205.GA23443@tarantool.org> (raw)
In-Reply-To: <20200604202309.GA146885@atlas>

On 04 Jun 23:23, Konstantin Osipov wrote:
> * Nikita Pettik <korablev@tarantool.org> [20/06/04 20:49]:
> > Meanwhile in 17f6af7dc the similar problem has been fixed, still it may
> > appear that in-memory level of secondary index being constructed has
> > lagging memory generation (in other words, it's values is less than
> > the value of current global generation). Such situation can be achieved
> > if yield which is required to check uniqueness of value being inserted
> > is too long. In this time gap other space may trigger dump process
> > bumping global memory generation counter, but dump itself is still not
> > yet scheduled.
> 
> It's hard for me to understand this comment, perhaps
>  you discussed the problem verbally, but I'm a bit out of context.
> 
> Could you write it using an event diagram, something like:
> 
> user1         user2            vy_scheduler
> 
> insert ...     
>              create_index()
> 
> 
> yield                            
>                                dump
> 
> ???
> 

Sure. In the first case vy_scheduler fiber is not waked up during yield in
vy_build_insert_tuple():

       user1                user2            scheduler         generation

s1:create_index              ---               idle               n

yield(*_insert_tuple)       s2:insert()        idle               n

yield                     *_trigger_dump()     idle              n+1

yield                      s2:rotate_mem()     idle              n+1

yield                         ---              idle              n+1

s1:*_insert_tuple continue     ---             idle              n+1

^
|

s1 still has mem generation n, meanwhile global and s2 generations is n+1.

Since we can't schedule fibers (and can't provide guarantee that
vy_scheduler fiber won't wake up), to reproduce the problem let's
assume that vy_task_dump_new fails for whatever reason:

       user1                user2            scheduler         generation

s1:create_index              ---               idle               n

yield(*_insert_tuple)       s2:insert()        idle               n

yield                     *_trigger_dump()     idle              n+1

yield                          ---         vy_task_dump_new      n+1

yield                          ---            throttled          n+1

s1:*_insert_tuple continue      ---           throttled          n+1

Again s1 has mem generation n, meanwhile global and s2 generations is n+1.


 
> -- 
> Konstantin Osipov, Moscow, Russia

  reply	other threads:[~2020-06-04 22:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 17:49 Nikita Pettik
2020-06-04 20:23 ` Konstantin Osipov
2020-06-04 22:32   ` Nikita Pettik [this message]
2020-06-04 22:52 ` Konstantin Osipov
2020-06-05 11:18   ` Nikita Pettik
2020-06-05 11:33     ` Konstantin Osipov
2020-06-06  8:38 ` Aleksandr Lyapunov
2020-06-07 15:51 ` Vladislav Shpilevoy
2020-06-09 22:34   ` Nikita Pettik
2020-06-15 13:54     ` Nikita Pettik
2020-06-23 22:43     ` Vladislav Shpilevoy
2020-06-23 23:11       ` Nikita Pettik
2020-07-22 22:54     ` Vladislav Shpilevoy
2020-06-10 15:27 ` Nikita Pettik

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=20200604223205.GA23443@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=alyapunov@tarantool.org \
    --cc=kostja.osipov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] vinyl: rotate mem during index build on demand' \
    /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