Tarantool development patches archive
 help / color / mirror / Atom feed
From: Georgy Kirichenko <georgy@tarantool.org>
To: Konstantin Osipov <kostja@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH 1/2] Update lua space cache just after creation
Date: Fri, 31 Aug 2018 07:53:49 +0300	[thread overview]
Message-ID: <2861224.UIpC4H89V2@home.lan> (raw)
In-Reply-To: <20180830123106.GB30997@chai>

[-- Attachment #1: Type: text/plain, Size: 2689 bytes --]

On Thursday, August 30, 2018 3:31:07 PM MSK Konstantin Osipov wrote:

> We can well use txn->on_commit trigger for this purpose, having
> set an on_commit trigger which pushes on_ctl events. This trigger
> is invoked *after* a record is written to wal in txn.cc. Why do
> you need to manipulate with the internal alter.cc triggers at all?
> Why is the order of invocation of these triggers important?
No, we can't, because generally there may be a space writes between space
 was created and space was commited. It is only current implementation issue  
that index creation acquires a ddl lock and stops applying.
> 
> Ideally, your on_ctl trigger should be invoked after all the alter
> triggers ahve been invoked. For that, all you need to do is to
> ensure that on_ctl trigger is added *after* the alter trigger -
> i.e. it has a lower priority/order than alter trigger. Is your
> problem with trigger ordering? Is it that you've been trying to
> add alter trigger *after* you added the on_ctl trigger, and, since
> triggers are normally added to the end of the list, when on_ctl
> trigger was invoked the space was not yet available in box.space?
My problem I can't see lua space object for a created space while on_replace 
fires because on_replace trigger fires at operation stage and lua cache updates 
only after commit - this is the issue. This can't be solved with trigger 
ordering cos triggers are running on different stages and the only way i see 
is to move space cache update trigger to the operation stage.
> 
> If it is the case, then I think we should simply add
> trigger_add_first() function, and use this function to add alter
> triggers to the beginning of the list.
First we should change stage of lua cache updates, that the patch does.
> 
> That would solve the problem until we have more strict ordering
> requirements, at which point we could add trigger->order member
> and trigger_add_with_order() method.
> 
> Finally, I don't see how the test case is testing the order. I
> believe the test case should pass both before and after the patch.
Test uses fiber scheduling mechanism, the first fiber creates the second one that 
creates a space and yields on wal. The first fiber checks that corresponding 
space objects is visible (the second fiber still waiting for a wal).
> 
> > @@ -1571,3 +1571,64 @@ fio = require('fio')
> > 
> >  box.space.test:drop()
> >  ---
> >  ...
> > 
> > +-- allocate a space id to prevent max space id update
> 
> Why is test description missing in the result file?
> 
> 
> Nitpick: please add leading -- and trailing -- to the test
> description, start it with a capital letter and end with a dot.
> 
> 
> Thanks for the patch,


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2018-08-31  4:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28 16:19 [tarantool-patches] [PATCH 0/2] Box control event trigger Georgy Kirichenko
2018-08-28 16:19 ` [tarantool-patches] [PATCH 1/2] Update lua space cache just after creation Georgy Kirichenko
2018-08-30 12:06   ` Vladimir Davydov
2018-08-31  4:57     ` [tarantool-patches] " Georgy Kirichenko
2018-08-30 12:31   ` Konstantin Osipov
2018-08-31  4:53     ` Georgy Kirichenko [this message]
2018-08-28 16:19 ` [tarantool-patches] [PATCH 2/2] On ctl event trigger Georgy Kirichenko
2018-08-30 12:07   ` Vladimir Davydov
2018-08-30 12:10   ` Vladimir Davydov
2018-08-30 12:38   ` Vladimir Davydov
2018-08-30 13:04     ` Georgy Kirichenko
2018-08-30 13:21     ` Vladimir Davydov
2018-08-30 14:45       ` [tarantool-patches] " Konstantin Osipov
2018-08-30 14:40     ` Konstantin Osipov
2018-08-30 12:50   ` Konstantin Osipov

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=2861224.UIpC4H89V2@home.lan \
    --to=georgy@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH 1/2] Update lua space cache just after creation' \
    /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