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

Drop old select #391

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions .github/workflows/test_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,17 @@ jobs:
github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
# We need 1.10.6 here to check that module works with
# old Tarantool versions that don't have "tuple-keydef"/"tuple-merger" support.
# We test old metrics with Tarantool 2.10 because since Tarantool 2.11.1
# it uses its own metrics package.
# We test old metrics with Cartridge 2.7.9 because since 2.8.0 it
# requires metrics 1.0.0.
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"]
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 @@ -85,11 +79,6 @@ jobs:
if: matrix.tarantool-version == 'master'
run: echo "${GITHUB_WORKSPACE}/bin" >> $GITHUB_PATH

- name: Fix luarocks in Tarantool CE 1.10.6
if: matrix.tarantool-version == '1.10.6'
run: |
sudo patch -p1 /usr/share/tarantool/luarocks/manif.lua luarocks.patch

- name: Install requirements for community
run: |
tarantool --version
Expand All @@ -102,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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ 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
* Drop testing on Tarantool 1.10.6 and Tarantool 2.x older than 2.8 (#365).
* 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

### Added
Expand Down
10 changes: 0 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
2 changes: 2 additions & 0 deletions crud-scm-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ dependencies = {
'checks >= 3.1.0-1',
'errors >= 2.2.1-1',
'vshard >= 0.1.18-1',
'tuple-merger >= 0.0.2',
'tuple-keydef >= 0.0.2',
}

build = {
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.

Loading