From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D12F146970F for ; Wed, 27 Nov 2019 14:18:30 +0300 (MSK) Date: Wed, 27 Nov 2019 14:18:27 +0300 From: Mergen Imeev Message-ID: <20191127111826.GA16940@tarantool.org> References: <84ae817b52e0d9415a0b89c730792b1e0221ff24.1574510839.git.imeevma@gmail.com> <20191126211234.GF23422@atlas> <20191127051523.qm3mjvng4pnqoe4y@tarantool.org> <20191127105206.GA16682@tarantool.org> <20191127110505.GA9233@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191127110505.GA9233@atlas> Subject: Re: [Tarantool-patches] [PATCH v4 2/2] box: introduce _vsession_settings sysview List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Konstantin Osipov Cc: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org On Wed, Nov 27, 2019 at 02:05:05PM +0300, Konstantin Osipov wrote: > * Mergen Imeev [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