Tarantool development patches archive
 help / color / mirror / Atom feed
From: Mergen Imeev <imeevma@tarantool.org>
To: Konstantin Osipov <kostja.osipov@gmail.com>
Cc: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v4 2/2] box: introduce _vsession_settings sysview
Date: Wed, 27 Nov 2019 15:12:30 +0300	[thread overview]
Message-ID: <20191127121230.GA29304@tarantool.org> (raw)
In-Reply-To: <20191127113741.GC9233@atlas>

On Wed, Nov 27, 2019 at 02:37:41PM +0300, Konstantin Osipov wrote:
> * Mergen Imeev <imeevma@tarantool.org> [19/11/27 14:22]:
> > > 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.
> 
> OK, so my point is that they were put there as a historical
> artefact of sqlite conversion. It seemed then as the most logical
> place to put them. PRAGMAs were internal, so it was not a big
> deal.
> 
> But going forward it's a dangerous place to store them, they should be
> global - it fattens the session object, and if there are more
> settings like these, there will be semantics issues. 
> 
> Besides, there will be a need for global counterpart anyway - since the
> next logical question is how to reset the session defaults? 
> 
> I.e. I want all new sessions to get created with
> sql_default_engine = vinyl, how do I do it?
> 
> Does my point make sense now?
> 
I think all these questions should solved in more global scope -
currently session is just a small object, that contains some
metadata. We cannot save or restore it. As far as I know, there
were some thougths of designing "session". That is all I know,
actually. Not sure that this should be solved in this issue.

As for the global settings - I think we have two ways:
1) Create a normal system space containing all the settings.
2) Create a structure containing these settings and save the
global settings there. Use the same approach as for session
settings after.

The first method looks more standard, but in this case we should
read from space every time we need the value of the setting, or
copy it somewhere else each time setting is changed to speed up
access.

Still, this has not yet been decided.

> > 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.
> 
> This is a neat implementation, I agree.
> 
> -- 
> Konstantin Osipov, Moscow, Russia

  reply	other threads:[~2019-11-27 12:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-23 12:11 [Tarantool-patches] [PATCH v4 0/2] " imeevma
2019-11-23 12:11 ` [Tarantool-patches] [PATCH v4 1/2] sysview: make get() and create_iterator() methods virtual imeevma
2019-11-23 12:12 ` [Tarantool-patches] [PATCH v4 2/2] box: introduce _vsession_settings sysview imeevma
2019-11-24 15:27   ` Vladislav Shpilevoy
2019-11-27  9:53     ` Mergen Imeev
2019-11-27 23:14       ` Vladislav Shpilevoy
2019-11-26 21:12   ` Konstantin Osipov
2019-11-27  5:15     ` Kirill Yukhin
2019-11-27 10:34       ` Konstantin Osipov
2019-11-27 10:52         ` Mergen Imeev
2019-11-27 11:05           ` Konstantin Osipov
2019-11-27 11:18             ` Mergen Imeev
2019-11-27 11:37               ` Konstantin Osipov
2019-11-27 12:12                 ` Mergen Imeev [this message]
2019-11-28  8:46 [Tarantool-patches] [PATCH v4 0/2] Introduce " imeevma
2019-11-28  8:46 ` [Tarantool-patches] [PATCH v4 2/2] box: introduce " imeevma

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=20191127121230.GA29304@tarantool.org \
    --to=imeevma@tarantool.org \
    --cc=kostja.osipov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v4 2/2] box: introduce _vsession_settings sysview' \
    /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