Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Oleg Babin <olegrok@tarantool.org>,
	tarantool-patches@dev.tarantool.org, korablev@tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] box: introduce "current" for sequence
Date: Thu, 12 Mar 2020 22:09:55 +0100	[thread overview]
Message-ID: <df29f9c4-fd7c-172e-6398-dac8c94624fd@tarantool.org> (raw)
In-Reply-To: <93dabcdb-313a-c911-b1a1-d87af0fb905c@tarantool.org>



On 12/03/2020 16:42, Oleg Babin wrote:
> Thanks for comments!
> 
> On 11/03/2020 01:49, Vladislav Shpilevoy wrote:
>> Here you said, that Tarantool has no sessions, but it is not so. We
>> have sessions, and even some session local things such as settings,
>> storage.
>>
> 
> It was a cite from https://github.com/tarantool/tarantool/commit/3ff1f1e36e14381c0ebb5862943d4da281254767:
> | In contrast to PostgreSQL, this method doesn't make sense in  | Tarantool, because we don't have sessions.
> 
> It was said before _session_storage was implemented but box.session has been already existed. I will try to drop this misleading statement and add: `In contrast "current" returns the last globally retrieved value of the sequence`. Ok?

I don't know why was it said back then that we don't have
sessions. Maybe Vova meant we don't have exactly the same sessions
as PostgreSQL, with full isolation and so on.

>> FFI has nothing to do with contracts. It is about performance.
>> We don't have a rule, that a whole subsystem should be either
>> completely in FFI, or completely in Lua C. Lots of things are
>> implemented in FFI + Lua C + Lua. For example, fiber module -
>> it uses all the 3 ways simultaneously. box_select() is FFI for
>> memtx, is Lua C for vinyl, and so on.
>>
>> On the contrary, we have a rule to make things via FFI when it
>> is possible (there was a discussion about that recently, don't
>> know whether it was formalized anywhere).
>>
>> Also I don't see any reason to make it FFI in a separate patch.
>> Why not in this one? What is a purpose of introducing a function
>> and re-implementing it right in a next patch and even create an
>> issue for that?
>>
>> The most reasonable split I see here is to introduce the C
>> function in one patch, and FFI in Lua in a second patch. In
>> scope of one patchset.
> 
> As we can use FFI for all functions that doesn't yield, we can rewrite e.g. "next" with FFI as well. It will be a bit more uniformly. And the idea is to do it in separate patch. But ok, I'll change "current" from Lua C API to FFI and send new patch.

It is not possible. Because sequence_next() can be used only via
box_sequence_next() by the public API. And box_sequence_next() can
yield. Box_sequence_set/reset/next() - all of them can yield.

> -- 
> Oleg Babin

      reply	other threads:[~2020-03-12 21:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06 16:34 olegrok
2020-03-09 23:40 ` Vladislav Shpilevoy
2020-03-10 19:08   ` Oleg Babin
2020-03-10 22:49     ` Vladislav Shpilevoy
2020-03-12 15:42       ` Oleg Babin
2020-03-12 21:09         ` Vladislav Shpilevoy [this message]

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=df29f9c4-fd7c-172e-6398-dac8c94624fd@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=olegrok@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] box: introduce "current" for sequence' \
    /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