Skip to content

Commit 1649b40

Browse files
authored
Fix remote-control greeting (#1558)
The greeting in the iproto protocol is used mostly for feature telling. For the remote-control server, it's not correct to respond with a version from the `_TARANTOOL` variable, because the `remote-control` implementation is constant. This patch locks the greeting on 1.10.0 as it corresponds to that feature set. This patch is necessary so that further tarantool versions could preserve `net.box` compatibility with `remote-control` server. See also tarantool/tarantool#6253
1 parent adf83b7 commit 1649b40

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

.github/workflows/backend-test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
id: cache-venv
3030
with:
3131
path: ./venv
32-
key: misc-venv-${{ hashFiles('rst/requirements.txt') }}-02
32+
key: misc-venv-${{ hashFiles('rst/requirements.txt') }}-03
3333
-
3434
run: |
3535
python -m venv ./venv && . ./venv/bin/activate
@@ -118,7 +118,7 @@ jobs:
118118
id: cache-pytest
119119
with:
120120
path: ./pytest-venv
121-
key: test-venv-${{ hashFiles('test/integration/requirements.txt') }}-02
121+
key: test-venv-${{ hashFiles('test/integration/requirements.txt') }}-03
122122
-
123123
run: |
124124
python -m venv ./pytest-venv && . ./pytest-venv/bin/activate

CHANGELOG.rst

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Fixed
2727
sync. This reduces the chance the hardware restart leads to WAL corruption
2828
([#1546](https://github.com/tarantool/cartridge/issues/1546)).
2929

30+
- Fix net.box clients compatibility with future tarantool 2.10 versions.
31+
3032
-------------------------------------------------------------------------------
3133
[2.7.1] - 2021-08-18
3234
-------------------------------------------------------------------------------

cartridge/remote-control.lua

+5-10
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ local errors = require('errors')
2020
local socket = require('socket')
2121
local digest = require('digest')
2222
local pickle = require('pickle')
23-
local uuid_lib = require('uuid')
2423
local msgpack = require('msgpack')
2524
local utils = require('cartridge.utils')
2625
local vars = require('cartridge.vars').new('cartridge.remote-control')
@@ -185,9 +184,8 @@ local function communicate(s)
185184
local sync = header[0x01]
186185

187186
if iproto_code[code] == nil then
188-
-- reply_err(s, sync or 0, box.error.UNKNOWN,
189-
-- "Unknown iproto code 0x%02x", code
190-
-- )
187+
-- Don't talk to strangers, it may confuse them.
188+
-- See https://github.com/tarantool/tarantool/issues/6451
191189
return false
192190

193191
elseif iproto_code[code] == 'iproto_select' then
@@ -285,23 +283,20 @@ local function communicate(s)
285283
return true
286284

287285
else
288-
-- reply_err(s, sync, box.error.UNSUPPORTED,
289-
-- "Remote Control doesn't support %s", iproto_code[code]
290-
-- )
286+
-- Don't talk to strangers, it may confuse them.
287+
-- See https://github.com/tarantool/tarantool/issues/6451
291288
return false
292289
end
293290
end
294291

295292
local function rc_handle(s)
296293
utils.fd_cloexec(s:fd())
297294

298-
local version = string.match(_TARANTOOL, "^([%d%.]+)") or '???'
299295
local salt = digest.urandom(32)
300296

301297
local greeting = string.format(
302298
'%-63s\n%-63s\n',
303-
'Tarantool ' .. version .. ' (Binary) ' .. uuid_lib.NULL:str(),
304-
-- 'Tarantool 1.10.3 (Binary) f1f1ab41-eae1-475b-b4bd-3fa8dd067f4d',
299+
'Tarantool 1.10.0 (Binary) 00000000-0000-0000-0000-000000000000',
305300
digest.base64_encode(salt)
306301
)
307302

0 commit comments

Comments
 (0)