Tarantool development patches archive
 help / color / mirror / Atom feed
From: "n.pettik" <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Alex Khatskevich <avkhatskevich@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH] Fix ephemeral table next rowid generation
Date: Tue, 19 Jun 2018 17:55:10 +0300	[thread overview]
Message-ID: <DC25CF8B-C043-4A7B-AB13-CDCD4ABEE1FE@tarantool.org> (raw)
In-Reply-To: <7ba42b74-d42b-8aa5-abb1-b2c08ae62302@tarantool.org>


>> Now I am thinking about introducing secondary index for table with rowid on the last field.
>> Could you take a look at code and say whether this idea feasible or not?
> I am absolutely against it. It is overkill, to maintain the whole index just to implement a
> counter.

Well, I am of the opinion that it is not overkill, but proper solution.
Lets ask smb else for advice. Personally I strictly against your approach.

>> In this case, it would be easy to fetch max value from ‘last’ field and increment it.
>> Anyway even if this idea fails as well, lets come up with better solution.
> Why you do not like saving the counter in the cursor?

Since cursor is a kind of wrapper around iterator, i.e. it represents only interface of 
internal routine. On the other hand, rowid belongs to the ‘user’ space. 
Moreover, not all ephemeral spaces needs this rowid. Finally, if smith went wrong
and insertion in such space occurred not via this cursor, then rowid would be
Incorrect and no warning or error would appear. I would like to remind you that
we wanted to avoid using cursors for insertions and removals.

> There is an option to maintain uint64 global counter, for all temp space rowids.

Hm, once I heard that using global variables might lead you straight to the hell...

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15 19:49 [tarantool-patches] " AKhatskevich
2018-05-31 23:53 ` [tarantool-patches] " n.pettik
     [not found]   ` <95f6ed87-03fb-c0ad-76e1-3776a0714e8b@tarantool.org>
2018-06-01 11:50     ` n.pettik
2018-06-01 12:16       ` Alex Khatskevich
2018-06-19 14:55         ` n.pettik [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=DC25CF8B-C043-4A7B-AB13-CDCD4ABEE1FE@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=avkhatskevich@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH] Fix ephemeral table next rowid generation' \
    /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