Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Serge Petrenko <sergepetrenko@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH] Do not update schema_version on space:truncate().
Date: Fri, 6 Jul 2018 17:07:54 +0300	[thread overview]
Message-ID: <20180706140754.GA3514@chai> (raw)
In-Reply-To: <20180706114625.10152-1-sergepetrenko@tarantool.org>

* Serge Petrenko <sergepetrenko@tarantool.org> [18/07/06 14:52]:
> Schema version is used by both clients and internal modules to check
> whether there vere any updates in spaces and indices. While clients
> only need to be notified when there is a noticeable change, e.g.
> space is removed, internal components also need to be notified when
> something like space:truncate() happens, because even though this
> operation doesn't change space id or any of its indices, it creates a
> new space object, so all the pointers to the old object have to be updated.
> Currently both clients and internals share the same schema version, which
> leads to unnecessary updates on the client side.
> 
> Fix this by implementing 2 separate counters for internal and public use:
> schema_state gets updated on every change, including recreation of the same
> space object, while schema_version is updated only when there are noticable
> changes for the clients. Introduce a new AlterOp to alter.cc to update
> public schema_version.
> Now all the internals reference schema_state, while all the clients use
> schema_version. box.iternal.schema_version() returns schema_version
> (the public one).

The new schema is instantiated/becomes effective in do(), not in commit. 

Before do() and commit() there is a yield and new queries
can see the new schema already.

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

  reply	other threads:[~2018-07-06 14:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-06 11:46 [tarantool-patches] " Serge Petrenko
2018-07-06 14:07 ` Konstantin Osipov [this message]
2018-07-06 14:24   ` [tarantool-patches] " Sergey Petrenko
2018-07-06 14:29     ` Konstantin Osipov
2018-07-06 15:15       ` Sergey 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=20180706140754.GA3514@chai \
    --to=kostja@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH] Do not update schema_version on space:truncate().' \
    /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