Skip to content

Commit

Permalink
crud: require tuple-keydef and tuple-merger
Browse files Browse the repository at this point in the history
This patch removes compatibility code that emulated `tuple-keydef` and
`tuple-merger` support when they were missing. Now it is required
to have this modules either internally r externally.

Closes #365
  • Loading branch information
DifferentialOrange committed Oct 18, 2023
1 parent 113d887 commit 9e275e4
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 807 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/test_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ jobs:
tarantool-version: ["1.10", "2.8", "2.10", "2.11"]
metrics-version: [""]
cartridge-version: ["2.8.0"]
remove-merger: [false]
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"
cartridge-version: "2.7.9"
Expand Down Expand Up @@ -95,10 +91,6 @@ 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

# This server starts and listen on 8084 port that is used for tests
- name: Stop Mono server
run: sudo kill -9 $(sudo lsof -t -i tcp:8084) || true
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* Drop support of Tarantool 1.10.x older than 1.10.8 and
Tarantool 2.x older than 2.5.2 (#365).
* Unlock `tuple-keydef` and `tuple-merger` version dependencies (#365).
* Require `tuple-keydef` and `tuple-merger` for work (#365).

## [1.4.0] - 16-10-23

Expand Down
4 changes: 0 additions & 4 deletions crud/common/stash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,12 @@ local stash = {}
-- @tfield string stats_metrics_registry
-- Stash for metrics rocks statistics registry.
--
-- @tfield string select_module_compat_info
-- Stash for select compatability version registry.
--
stash.name = {
cfg = '__crud_cfg',
stats_internal = '__crud_stats_internal',
stats_local_registry = '__crud_stats_local_registry',
stats_metrics_registry = '__crud_stats_metrics_registry',
ddl_triggers = '__crud_ddl_spaces_triggers',
select_module_compat_info = '__select_module_compat_info',
storage_readview = '__crud_storage_readview',
}

Expand Down
14 changes: 2 additions & 12 deletions crud/readview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,20 @@ local stats = require('crud.stats')

local ReadviewError = errors.new_class('ReadviewError', {capture_stack = false})

local has_merger = (utils.tarantool_supports_external_merger() and
package.search('tuple.merger')) or utils.tarantool_has_builtin_merger()

local OPEN_FUNC_NAME = 'readview_open_on_storage'
local CRUD_OPEN_FUNC_NAME = utils.get_storage_call(OPEN_FUNC_NAME)
local SELECT_FUNC_NAME = 'select_readview_on_storage'
local CLOSE_FUNC_NAME = 'readview_close_on_storage'
local CRUD_CLOSE_FUNC_NAME = utils.get_storage_call(CLOSE_FUNC_NAME)

if (not utils.tarantool_version_at_least(2, 11, 0))
or (tarantool.package ~= 'Tarantool Enterprise') or (not has_merger) then
or (tarantool.package ~= 'Tarantool Enterprise') then
return {
new = function() return nil,
ReadviewError:new("Tarantool does not support readview") end,
init = function() return nil end}
end
local select = require('crud.select.compat.select')
local select = require('crud.select.module')

local readview = {}

Expand Down Expand Up @@ -188,13 +185,6 @@ local function select_readview_on_storage(space_name, index_id, conditions, opts

local result = {cursor, filtered_tuples}

local select_module_compat_info = stash.get(stash.name.select_module_compat_info)
if not select_module_compat_info.has_merger then
if opts.fetch_latest_metadata then
result[3] = cursor.storage_info.replica_schema_version
end
end

return unpack(result)
end

Expand Down
22 changes: 1 addition & 21 deletions crud/select.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
local errors = require('errors')

local stash = require('crud.common.stash')
local utils = require('crud.common.utils')
local sharding = require('crud.common.sharding')
local select_executor = require('crud.select.executor')
Expand All @@ -10,20 +9,9 @@ local schema = require('crud.common.schema')

local SelectError = errors.new_class('SelectError')

local select_module

local SELECT_FUNC_NAME = 'select_on_storage'

local select_module_compat_info = stash.get(stash.name.select_module_compat_info)
local has_merger = (utils.tarantool_supports_external_merger() and
package.search('tuple.merger')) or utils.tarantool_has_builtin_merger()
if has_merger then
select_module = require('crud.select.compat.select')
select_module_compat_info.has_merger = true
else
select_module = require('crud.select.compat.select_old')
select_module_compat_info.has_merger = false
end
local select_module = require('crud.select.module')

function checkers.vshard_call_mode(p)
return p == 'write' or p == 'read'
Expand Down Expand Up @@ -114,14 +102,6 @@ local function select_on_storage(space_name, index_id, conditions, opts)
local filtered_tuples = schema.filter_tuples_fields(resp.tuples, opts.field_names)

local result = {cursor, filtered_tuples}

local select_module_compat_info = stash.get(stash.name.select_module_compat_info)
if not select_module_compat_info.has_merger then
if opts.fetch_latest_metadata then
result[3] = cursor.storage_info.replica_schema_version
end
end

return unpack(result)
end

Expand Down
30 changes: 0 additions & 30 deletions crud/select/compat/common.lua

This file was deleted.

0 comments on commit 9e275e4

Please sign in to comment.