diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index ade54e06..9c746958 100644 --- a/.github/workflows/test_on_push.yaml +++ b/.github/workflows/test_on_push.yaml @@ -20,13 +20,13 @@ jobs: tarantool-version: ["1.10.6", "1.10", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "2.8", "2.10", "2.11"] metrics-version: [""] cartridge-version: ["2.8.0"] - remove-merger: [false] + external-tuple-merger-version: [""] + external-tuple-keydef-version: [""] include: - tarantool-version: "1.10" metrics-version: "1.0.0" cartridge-version: "2.8.0" - tarantool-version: "2.7" - remove-merger: true cartridge-version: "2.8.0" - tarantool-version: "2.10" metrics-version: "0.10.0" @@ -38,6 +38,9 @@ jobs: - tarantool-version: "2.11" metrics-version: "1.0.0" vshard-version: "0.1.24" + - tarantool-version: "2.11" + external-merger-version: "0.0.5" + external-keydef-version: "0.0.4" - tarantool-version: "master" metrics-version: "1.0.0" vshard-version: "0.1.24" @@ -102,9 +105,13 @@ jobs: if: matrix.metrics-version != '' run: tt rocks install metrics ${{ matrix.metrics-version }} - - name: Remove external merger if needed - if: ${{ matrix.remove-merger }} - run: rm .rocks/lib/tarantool/tuple/merger.so + - name: Install external tuple-merger + if: matrix.external-tuple-merger-version != '' + run: tt rocks install tuple-merger ${{ matrix.external-tuple-merger-version }} + + - name: Install external tuple-keydef + if: matrix.external-tuple-keydef-version != '' + run: tt rocks install tuple-keydef ${{ matrix.external-tuple-keydef-version }} # This server starts and listen on 8084 port that is used for tests - name: Stop Mono server diff --git a/CHANGELOG.md b/CHANGELOG.md index 47629ee1..01fa1c47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed +* Dropped external tuple merger and tuple keydef modules installation from the + package build (#390). + +### Fixed +* Compatibility with Tarantool 3.0 binary protocol change (#390). +* Compatibility with Tarantool 3.0 tuple objects (#390). + ## [1.4.0] - 16-10-23 ### Added diff --git a/CMakeLists.txt b/CMakeLists.txt index 3485b788..04bdfefa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,13 +95,3 @@ install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cartridge DESTINATION ${TARANTOOL_INSTALL_LUADIR} ) - -# Don't include to rockspec as some Tarantool versions (e.g. 2.2 and 2.3) -# don't have symbols required by "tuple-merger" and "tuple-keydef" modules. -execute_process( - COMMAND bash "-c" "tarantoolctl rocks install tuple-keydef 0.0.2" -) - -execute_process( - COMMAND bash "-c" "tarantoolctl rocks install tuple-merger 0.0.2" -) diff --git a/crud/common/utils.lua b/crud/common/utils.lua index 2d843df3..1c7f8aeb 100644 --- a/crud/common/utils.lua +++ b/crud/common/utils.lua @@ -639,6 +639,9 @@ local function determine_enabled_features() or is_version_in_range(major, minor, patch, suffix, 1, 10, 8, nil, 1, 10, math.huge, nil) + + enabled_tarantool_features.netbox_skip_header_option = is_version_ge(major, minor, patch, suffix, + 2, 2, 0, nil) end function utils.tarantool_supports_fieldpaths() @@ -681,6 +684,14 @@ function utils.tarantool_supports_external_merger() return enabled_tarantool_features.external_merger end +function utils.tarantool_supports_netbox_skip_header_option() + if enabled_tarantool_features.netbox_skip_header_option == nil then + determine_enabled_features() + end + + return enabled_tarantool_features.netbox_skip_header_option +end + local function add_nullable_fields_recursive(operations, operations_map, space_format, tuple, id) if id < 2 or tuple[id - 1] ~= box.NULL then return operations diff --git a/crud/select.lua b/crud/select.lua index e879cc0a..ffb850cc 100644 --- a/crud/select.lua +++ b/crud/select.lua @@ -31,8 +31,8 @@ end local function select_on_storage(space_name, index_id, conditions, opts) dev_checks('string', 'number', '?table', { - scan_value = 'table', - after_tuple = '?table', + scan_value = 'table|cdata', + after_tuple = '?table|cdata', tarantool_iter = 'number', limit = 'number', scan_condition_num = '?number', diff --git a/crud/select/executor.lua b/crud/select/executor.lua index d432c62e..40df8a27 100644 --- a/crud/select/executor.lua +++ b/crud/select/executor.lua @@ -76,8 +76,8 @@ end function executor.execute(space, index, filter_func, opts) dev_checks('table', 'table', 'function', { - scan_value = 'table', - after_tuple = '?table', + scan_value = 'table|cdata', + after_tuple = '?table|cdata', tarantool_iter = 'number', limit = '?number', yield_every = '?number', diff --git a/crud/select/merger.lua b/crud/select/merger.lua index b56e993e..46dbcff5 100644 --- a/crud/select/merger.lua +++ b/crud/select/merger.lua @@ -58,17 +58,7 @@ end local data = ffi.new('const unsigned char *[1]') -local function decode_response_headers(buf) - -- {48: [cursor, [tuple_1, tuple_2, ...]]} (exactly 1 pair of key-value) - data[0] = buf.rpos - - -- 48 (key) - data[0] = data[0] + 1 - - -- [cursor, [tuple_1, tuple_2, ...]] (value) - data[0] = data[0] + 1 - - -- Decode array header +local function decode_response_array_header() local c = data[0][0] data[0] = data[0] + 1 if c == 0xdc then @@ -80,6 +70,22 @@ local function decode_response_headers(buf) return ffi.cast(char_ptr, data[0]) end +local function decode_response_headers(buf) + data[0] = buf.rpos + + if not utils.tarantool_supports_netbox_skip_header_option() then + -- {48: [cursor, [tuple_1, tuple_2, ...]]} (exactly 1 pair of key-value) + + -- 48 (key) + data[0] = data[0] + 1 + + -- [cursor, [tuple_1, tuple_2, ...]] (value) + data[0] = data[0] + 1 + end + + return decode_response_array_header() +end + local function decode_metainfo(buf) -- Skip an array around a call return values. buf.rpos = decode_response_headers(buf) @@ -192,7 +198,8 @@ local function new(vshard_router, replicasets, space, index_id, func_name, func_ for _, replicaset in pairs(replicasets) do -- Perform a request. local buf = buffer.ibuf() - local net_box_opts = {is_async = true, buffer = buf, skip_header = false} + local net_box_opts = {is_async = true, buffer = buf, + skip_header = utils.tarantool_supports_netbox_skip_header_option() or nil} local future = replicaset[vshard_call_name](replicaset, func_name, func_args, net_box_opts) @@ -249,7 +256,8 @@ local function new_readview(vshard_router, replicasets, readview_uuid, space, in if replica_uuid == value.uuid then -- Perform a request. local buf = buffer.ibuf() - local net_box_opts = {is_async = true, buffer = buf, skip_header = false} + local net_box_opts = {is_async = true, buffer = buf, + skip_header = utils.tarantool_supports_netbox_skip_header_option() or nil} func_args[4].readview_id = value.id local future = replica.conn:call(func_name, func_args, net_box_opts)