[Tarantool-patches] [PATCH v4 2/2] box: introduce _vsession_settings sysview
Mergen Imeev
imeevma at tarantool.org
Wed Nov 27 14:18:27 MSK 2019
On Wed, Nov 27, 2019 at 02:05:05PM +0300, Konstantin Osipov wrote:
> * Mergen Imeev <imeevma at tarantool.org> [19/11/27 13:56]:
> > Hi! Thanks for the review. However, I think you are a little
> > wrong. We do not save these settings anywhere except for the
> > struct session. When a user reads from the space, it creates
> > tuples on the fly and passes them to the user. All of this can
> > actually be read from the commit-message:
> >
> >
> > box: introduce _vsession_settings sysview
> >
> > This patch creates the _vsession_settings sysview. This sysview
> > contains names and values of the session settings.
> >
> > This sysview creates tuples on the fly using its own get() and
> > create_iterator() methods. This allows us to get a tuple without
> > having to save it anywhere. But this means that every time we get
> > a tuple from this system view, it is a new tuple, even if they
> > look the same:
> >
> > tarantool> v = box.space._vsession_settings
> > tarantool> v:get({'sql_default_engine'}) ~= v:get({'sql_default_engine'})
> > ---
> > - true
> > ...
> >
> > Currently, only SQL settings can be extracted from this sysview,
> > since the only session settings are SQL settings.
>
> Where do you get the value from to build the tuple?
>
I get it from current_session()->sql_flags and
current_session()->sql_default_engine.
> Where is it stored? If it is stored per-session, I mean
> struct-session, then my comment is still valid.
>
There is only one place where all these settings are
stored. If this is not what you mean, then I cannot
understand you at the moment.
> I'm not challenging the implementation details (I did not read the
> patch indeed), I am challenging the semantics.
>
> The view is called _vsession_settings, so I assume its state
> (semantically) is local to each database connection, to which I
> objected.
>
I think that the system view state is the same for all
sessions. It is empty, it has the same methods. However, it
can give different results, because when it gives tuples,
it reads from the session state (current_session()) to
create them.
> --
> Konstantin Osipov, Moscow, Russia
More information about the Tarantool-patches
mailing list