Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to call a function on tarantool-1.10* from tarantool-2* with net.box #4307

Closed
Totktonada opened this issue Jun 23, 2019 · 1 comment
Closed
Assignees
Labels
bug Something isn't working regression
Milestone

Comments

@Totktonada
Copy link
Member

Tarantool versions:

  • Server: 1.10.3-73-g154d4f526 Linux-x86_64-Debug.
  • Client (net.box): 2.2.0-423-gd3b2bcb66 Linux-x86_64-Debug.

OS version: Gentoo Linux.

server.lua

#!/usr/bin/env tarantool

box.cfg({listen = 3301})

box.once('init', function()
    box.schema.user.grant('guest', 'read,write,execute,create,alter,drop',
                          'universe')
end)

function echo(...)
    return ...
end

client.lua

#!/usr/bin/env tarantool

local net_box = require('net.box')
local json = require('json')

local connection = net_box.connect('localhost:3301')
local response = {connection:call('echo', {1, 2, 3})}
print(json.encode(response)) -- [1,2,3]
os.exit()

When both server and client are run with 2.2 or 1.10 the client prints [1,2,3] as expected. When the server is on 1.10, but the client is on 2.2 the output is Space '277' does not exist. 277 is ID of _vcollation system space.

Looks as the regression from of #3941.

@Totktonada Totktonada added the bug Something isn't working label Jun 23, 2019
@kyukhin kyukhin added this to the 2.2.0 milestone Jun 30, 2019
romanhabibov added a commit that referenced this issue Jul 8, 2019
Ignore error about absence of _vcollation, when a client connects
to a server of old Tarantool versions, where this space does not
exist.

Closes #4307
@cyrillos
Copy link
Contributor

@romanhabibov This patch fixes similar problem for me.

romanhabibov added a commit that referenced this issue Jul 19, 2019
The error occured, when a client connects to a server of old
Tarantool versions, where _vcollation space does not exist. After
this patch, _vcollation is fetched depending on a server version.

Closes #4307
@Totktonada Totktonada self-assigned this Jul 29, 2019
Totktonada added a commit that referenced this issue Jul 30, 2019
After 2.2.0-390-ga7c855e5b ("net.box: fetch '_vcollation' sysview into
the module") net.box fetches _vcollation view unconditionally, while the
view was added in 2.2.0-389-g3e3ef182f and, say, tarantool-1.10 and
tarantool-2.1 do not have it. This leads to a runtime error "Space '277'
does not exist" on a newer client that connects to an older server.

Now the view is fetched conditionally depending of a version of a
server: if it is above 2.2.1, then net.box will fetch it. Note: at the
time there are no release with a number above 2.2.1.

When _vcollation view is available, a collation in an index part will be
shown by its name (with 'collation' field), otherwise it will be shown
by its ID (in 'collation_id' field). For example:

Connect to tarantool 1.10:

 | tarantool> connection = require('net.box').connect('localhost:3301')
 | ---
 | ...
 |
 | tarantool> connection.space.s.index.sk.parts
 | ---
 | - - type: string
 |     is_nullable: false
 |     collation_id: 2
 |     fieldno: 2
 | ...

Connect to tarantool 2.2.1 (when it will be released):

 | tarantool> connection = require('net.box').connect('localhost:3301')
 | ---
 | ...
 |
 | tarantool> connection.space.s.index.sk.parts
 | ---
 | - - type: string
 |     is_nullable: false
 |     collation: unicode_ci
 |     fieldno: 2
 | ...

Fixes #4307.
Totktonada added a commit that referenced this issue Jul 30, 2019
After 2.2.0-390-ga7c855e5b ("net.box: fetch '_vcollation' sysview into
the module") net.box fetches _vcollation view unconditionally, while the
view was added in 2.2.0-389-g3e3ef182f and, say, tarantool-1.10 and
tarantool-2.1 do not have it. This leads to a runtime error "Space '277'
does not exist" on a newer client that connects to an older server.

Now the view is fetched conditionally depending of a version of a
server: if it is above 2.2.1, then net.box will fetch it. Note: at the
time there are no release with a number above 2.2.1.

When _vcollation view is available, a collation in an index part will be
shown by its name (with 'collation' field), otherwise it will be shown
by its ID (in 'collation_id' field). For example:

Connect to tarantool 1.10:

 | tarantool> connection = require('net.box').connect('localhost:3301')
 | ---
 | ...
 |
 | tarantool> connection.space.s.index.sk.parts
 | ---
 | - - type: string
 |     is_nullable: false
 |     collation_id: 2
 |     fieldno: 2
 | ...

Connect to tarantool 2.2.1 (when it will be released):

 | tarantool> connection = require('net.box').connect('localhost:3301')
 | ---
 | ...
 |
 | tarantool> connection.space.s.index.sk.parts
 | ---
 | - - type: string
 |     is_nullable: false
 |     collation: unicode_ci
 |     fieldno: 2
 | ...

Fixes #4307.
Totktonada added a commit that referenced this issue Apr 1, 2020
After 2.2.0-633-gaa0964ae1 ('net.box: fix schema fetching from 1.10/2.1
servers') net.box expects that _vcollation system view exists on a
tarantool server of 2.2.1+ version. This is however not always so: a
server may be run on a new version of tarantool, but work on a schema of
an old version.

The situation with non last schema is usual for replication cluster in
process of upgrading: all instances run on the new version of tarantool
first (no auto-upgrade is performed by tarantools in a cluster). Then
box.schema.upgrade() should be called, but the instances should be
operable even before the call.

Before the commit net.box was unable to connect a server if it is run on
a schema without _vcollation system view (say, 2.1.3), but the server
executable is of 2.2.1 version or newer.

Follows up #4307
Fixes #4691
Totktonada added a commit that referenced this issue Apr 20, 2020
After 2.2.0-633-gaa0964ae1 ('net.box: fix schema fetching from 1.10/2.1
servers') net.box expects that _vcollation system view exists on a
tarantool server of 2.2.1+ version. This is however not always so: a
server may be run on a new version of tarantool, but work on a schema of
an old version.

The situation with non last schema is usual for replication cluster in
process of upgrading: all instances run on the new version of tarantool
first (no auto-upgrade is performed by tarantools in a cluster). Then
box.schema.upgrade() should be called, but the instances should be
operable even before the call.

Before the commit net.box was unable to connect a server if it is run on
a schema without _vcollation system view (say, 2.1.3), but the server
executable is of 2.2.1 version or newer.

Note: I trim tests from the commit to polish them a bit more, but
include the fix itself to 2.4.1 release.

Follows up #4307
Fixes #4691
kyukhin pushed a commit that referenced this issue Apr 20, 2020
After 2.2.0-633-gaa0964ae1 ('net.box: fix schema fetching from 1.10/2.1
servers') net.box expects that _vcollation system view exists on a
tarantool server of 2.2.1+ version. This is however not always so: a
server may be run on a new version of tarantool, but work on a schema of
an old version.

The situation with non last schema is usual for replication cluster in
process of upgrading: all instances run on the new version of tarantool
first (no auto-upgrade is performed by tarantools in a cluster). Then
box.schema.upgrade() should be called, but the instances should be
operable even before the call.

Before the commit net.box was unable to connect a server if it is run on
a schema without _vcollation system view (say, 2.1.3), but the server
executable is of 2.2.1 version or newer.

Note: I trim tests from the commit to polish them a bit more, but
include the fix itself to 2.4.1 release.

Follows up #4307
Fixes #4691

(cherry picked from commit 06edcbe)
kyukhin pushed a commit that referenced this issue Apr 20, 2020
After 2.2.0-633-gaa0964ae1 ('net.box: fix schema fetching from 1.10/2.1
servers') net.box expects that _vcollation system view exists on a
tarantool server of 2.2.1+ version. This is however not always so: a
server may be run on a new version of tarantool, but work on a schema of
an old version.

The situation with non last schema is usual for replication cluster in
process of upgrading: all instances run on the new version of tarantool
first (no auto-upgrade is performed by tarantools in a cluster). Then
box.schema.upgrade() should be called, but the instances should be
operable even before the call.

Before the commit net.box was unable to connect a server if it is run on
a schema without _vcollation system view (say, 2.1.3), but the server
executable is of 2.2.1 version or newer.

Note: I trim tests from the commit to polish them a bit more, but
include the fix itself to 2.4.1 release.

Follows up #4307
Fixes #4691

(cherry picked from commit 06edcbe)
kyukhin pushed a commit that referenced this issue Apr 20, 2020
After 2.2.0-633-gaa0964ae1 ('net.box: fix schema fetching from 1.10/2.1
servers') net.box expects that _vcollation system view exists on a
tarantool server of 2.2.1+ version. This is however not always so: a
server may be run on a new version of tarantool, but work on a schema of
an old version.

The situation with non last schema is usual for replication cluster in
process of upgrading: all instances run on the new version of tarantool
first (no auto-upgrade is performed by tarantools in a cluster). Then
box.schema.upgrade() should be called, but the instances should be
operable even before the call.

Before the commit net.box was unable to connect a server if it is run on
a schema without _vcollation system view (say, 2.1.3), but the server
executable is of 2.2.1 version or newer.

Note: I trim tests from the commit to polish them a bit more, but
include the fix itself to 2.4.1 release.

Follows up #4307
Fixes #4691
Totktonada added a commit to Totktonada/tarantool that referenced this issue Jan 9, 2023
See tarantool#4691 for the problem description. In brief: before the fix net.box
expected _vcollation presence if tarantool's runtime on the server is
new enough disregarding a server's schema version. The old schema
version has no this view, so net.box was unable to connect. After tarantool#4691
net.box tolerates lack of the view.

The fix was pushed without a test (see [1]) and now I want to pay this
debt.

[1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-April/016207.html

Follows up tarantool#4307
Follows up tarantool#4691
Fixes tarantool#5482

NO_DOC=just a new test
NO_CHANGELOG=see NO_DOC
Totktonada added a commit to Totktonada/tarantool that referenced this issue Jan 9, 2023
See tarantool#4691 for the problem description. In brief: before the fix net.box
expected _vcollation presence if tarantool's runtime on the server is
new enough disregarding a server's schema version. The old schema
version has no this view, so net.box was unable to connect. After tarantool#4691
net.box tolerates lack of the view.

The fix was pushed without a test (see [1]) and now I want to pay this
debt.

[1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-April/016207.html

Follows up tarantool#4307
Follows up tarantool#4691
Fixes tarantool#5482

NO_DOC=just a new test
NO_CHANGELOG=see NO_DOC
Totktonada added a commit to Totktonada/tarantool that referenced this issue Jan 13, 2023
See tarantool#4691 for the problem description. In brief: before the fix net.box
expected _vcollation presence if tarantool's runtime on the server is
new enough disregarding a server's schema version. The old schema
version has no this view, so net.box was unable to connect. After tarantool#4691
net.box tolerates lack of the view.

The fix was pushed without a test (see [1]) and now I want to pay this
debt.

[1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-April/016207.html

Follows up tarantool#4307
Follows up tarantool#4691
Fixes tarantool#5482

NO_DOC=just a new test
NO_CHANGELOG=see NO_DOC
Totktonada added a commit to Totktonada/tarantool that referenced this issue Jan 25, 2023
See tarantool#4691 for the problem description. In brief: before the fix net.box
expected _vcollation presence if tarantool's runtime on the server is
new enough disregarding a server's schema version. The old schema
version has no this view, so net.box was unable to connect. After tarantool#4691
net.box tolerates lack of the view.

The fix was pushed without a test (see [1]) and now I want to pay this
debt.

[1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-April/016207.html

Follows up tarantool#4307
Follows up tarantool#4691
Fixes tarantool#5482

NO_DOC=just a new test
NO_CHANGELOG=see NO_DOC
Totktonada added a commit that referenced this issue Jan 25, 2023
See #4691 for the problem description. In brief: before the fix net.box
expected _vcollation presence if tarantool's runtime on the server is
new enough disregarding a server's schema version. The old schema
version has no this view, so net.box was unable to connect. After #4691
net.box tolerates lack of the view.

The fix was pushed without a test (see [1]) and now I want to pay this
debt.

[1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-April/016207.html

Follows up #4307
Follows up #4691
Fixes #5482

NO_DOC=just a new test
NO_CHANGELOG=see NO_DOC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression
Projects
None yet
Development

No branches or pull requests

4 participants