Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Roman Khabibov <roman.habibov@tarantool.org>
Cc: tarantool-patches@freelists.org,
	Konstantin Osipov <kostja.osipov@gmail.com>,
	Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	Kirill Yukhin <kyukhin@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH] net.box: ignore absence of _vcollation
Date: Thu, 25 Jul 2019 00:27:43 +0300	[thread overview]
Message-ID: <20190724212743.jwrti2iuclleogjq@tkn_work_nb> (raw)
In-Reply-To: <20190720190714.5pejxoy2ae43nssp@tkn_work_nb>

On Sat, Jul 20, 2019 at 10:07:14PM +0300, Alexander Turenko wrote:
> > > diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua
> > > index 2892bb3d3..723e63045 100644
> > > --- a/src/box/lua/net_box.lua
> > > +++ b/src/box/lua/net_box.lua
> > > @@ -761,6 +761,11 @@ local function create_transport(host, port, user, password, callback,
> > >                  if status ~= 0 then
> > >                      local body
> > >                      body, body_end = decode(body_rpos)
> > > +                    local err_msg = 'Space \'277\' does not exist'
> > 
> > Space 277? Seriously? This code handles not only collations request.
> > Should be more generic, IMHO.
> 
> Of course, it is better to use VCOLLATION_ID constant that already
> defined above.
> 
> Kirill, I didn't got your comment. This error message is only about one
> specific case: there is no such space. I think this approach is better
> then version check (that is proposed in the next version of the patch),
> because of readability: the version check approach leads to many small
> if's, while here we add only one check.
> 
> BTW, Kostja also has a comment:
> https://github.com/tarantool/tarantool/commit/47227cfa4c9bac76a882464a2d0440e5137f158e#commitcomment-34342515
> 
> WBR, Alexander Turenko.

We discussed two approaches with Kostja:

* Ignore _vcollation absense on a peer during schema (re)load:
  https://github.com/tarantool/tarantool/commit/47227cfa4c9bac76a882464a2d0440e5137f158e
* Don't fire a request according to a peer tarantool version:
  https://github.com/tarantool/tarantool/commit/abc88ef8d38e21a6c7faf925a19105ce65d45467

Summary of the discussion:

* The former lean on the fact that the only reason of the error re
  absense of _vcollation is an old version of a server. There is no
  guarantee that this assumption will retain in the future.
* The former approach checks an error message against a pattern.
  Changing of the error message will break backward compatibility.
* The latter approach looks bigger then the former one, because of
  passthrough of remote.peer_version_id value and more code with
  branching. We should try to find better way to implement this
  approach.
* Kostja also mentioned possibility to return 'collation' field always,
  even for old peers: just use a table with default collation_id -
  collation (string) mapping. It will not work with non-standard
  collations, but maybe it worth to consider this approach anyway.

To be honest I don't know net.box code enough to propose better way to
implement 2nd approach. Vlad, it would be great if you will look into
this and give some pointers to Roman, if time allows.

CCed Kostja and Vlad.

WBR, Alexander Turenko.

  reply	other threads:[~2019-07-24 21:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08 12:13 [tarantool-patches] " Roman Khabibov
2019-07-12  9:55 ` [tarantool-patches] " Kirill Yukhin
2019-07-19 12:16   ` Roman Khabibov
2019-07-20 19:07   ` Alexander Turenko
2019-07-24 21:27     ` Alexander Turenko [this message]
2019-07-24 22:43       ` Vladislav Shpilevoy
2019-07-30 10:58         ` Alexander Turenko
2019-07-30 12:08           ` Konstantin Osipov
2019-07-30 20:18           ` Vladislav Shpilevoy
2019-07-30 22:35             ` Alexander Turenko

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=20190724212743.jwrti2iuclleogjq@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=kostja.osipov@gmail.com \
    --cc=kyukhin@tarantool.org \
    --cc=roman.habibov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='[tarantool-patches] Re: [PATCH] net.box: ignore absence of _vcollation' \
    /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