From 6ec49d1b7209d54a7f325a97c385d756886b69b6 Mon Sep 17 00:00:00 2001 From: Igor Zolotarev Date: Thu, 4 Jul 2024 17:58:28 +0300 Subject: [PATCH] Remove vshard-ee and ddl-ee --- CHANGELOG.rst | 8 ++++++++ cartridge/lua-api/boxinfo.lua | 20 +++----------------- cartridge/roles.lua | 9 +-------- cartridge/roles/vshard-router.lua | 5 +---- cartridge/roles/vshard-storage.lua | 5 +---- cartridge/twophase.lua | 16 +++------------- cartridge/utils.lua | 5 +---- cartridge/vshard-utils.lua | 5 +---- cartridge/webui/api-config.lua | 8 +------- cartridge/webui/api-ddl.lua | 18 ++++-------------- 10 files changed, 24 insertions(+), 75 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f10ab77a4..dfcf58c48 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -12,6 +12,14 @@ and this project adheres to Unreleased ------------------------------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Changed +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- Cartridge doesn't use ``vshard-ee`` instead of ``vshard``. + +- Cartridge doesn't use ``ddl-ee`` instead of ``ddl``. + ------------------------------------------------------------------------------- [2.12.2] - 2024-06-24 ------------------------------------------------------------------------------- diff --git a/cartridge/lua-api/boxinfo.lua b/cartridge/lua-api/boxinfo.lua index edc3e4994..1e4e8cbce 100644 --- a/cartridge/lua-api/boxinfo.lua +++ b/cartridge/lua-api/boxinfo.lua @@ -10,6 +10,9 @@ local pool = require('cartridge.pool') local confapplier = require('cartridge.confapplier') local vars = require('cartridge.vars').new('cartridge.boxinfo') +local vshard_version = require('vshard')._VERSION +local ddl_version = require('ddl')._VERSION + vars:new('webui_prefix', nil) vars:new('http_host', nil) vars:new('http_port', nil) @@ -51,23 +54,6 @@ local function get_info(uri) local membership_myself = require('membership').myself() local membership_options = require('membership.options') - local ok, vshard, vshard_version, ddl, ddl_version - ok, vshard = pcall(require, 'vshard-ee') - if ok then - vshard_version = vshard._VERSION .. ' EE' - else - vshard = require('vshard') - vshard_version = vshard._VERSION - end - - ok, ddl = pcall(require, 'ddl-ee') - if ok then - ddl_version = ddl._VERSION .. ' EE' - else - ddl = require('ddl') - ddl_version = ddl._VERSION - end - local routers = vshard and vshard.router.internal.routers or {} local router_info = {} if next(routers) ~= nil then diff --git a/cartridge/roles.lua b/cartridge/roles.lua index fe27cf7af..033a6737b 100644 --- a/cartridge/roles.lua +++ b/cartridge/roles.lua @@ -34,17 +34,10 @@ vars:new('roles_by_module_name', {}) vars:new('implicit_roles') vars:new('pause', false) -local ddl_role_name -local ok, _ = pcall(require, 'ddl-ee') -if ok then - ddl_role_name = 'cartridge.roles.ddl-manager-ee' -else - ddl_role_name = 'cartridge.roles.ddl-manager' -end -- Don't put it as default var value to allow overriding -- after hot-reload (hypothetically) vars.implicit_roles = { - ddl_role_name, + 'cartridge.roles.ddl-manager', 'cartridge.roles.coordinator', } diff --git a/cartridge/roles/vshard-router.lua b/cartridge/roles/vshard-router.lua index 1741f3231..3747044c0 100644 --- a/cartridge/roles/vshard-router.lua +++ b/cartridge/roles/vshard-router.lua @@ -1,9 +1,6 @@ local log = require('log') -local ok, vshard = pcall(require, 'vshard-ee') -if not ok then - vshard = require('vshard') -end +local vshard = require('vshard') local checks = require('checks') local errors = require('errors') diff --git a/cartridge/roles/vshard-storage.lua b/cartridge/roles/vshard-storage.lua index e1b943b08..a7e864b0f 100644 --- a/cartridge/roles/vshard-storage.lua +++ b/cartridge/roles/vshard-storage.lua @@ -1,9 +1,6 @@ local log = require('log') -local ok, vshard = pcall(require, 'vshard-ee') -if not ok then - vshard = require('vshard') -end +local vshard = require('vshard') local checks = require('checks') diff --git a/cartridge/twophase.lua b/cartridge/twophase.lua index d8f761a0e..7ec54623d 100644 --- a/cartridge/twophase.lua +++ b/cartridge/twophase.lua @@ -12,6 +12,7 @@ local yaml = require('yaml').new() local errno = require('errno') local errors = require('errors') local checks = require('checks') +local ddl = require('ddl') local vars = require('cartridge.vars').new('cartridge.twophase') local pool = require('cartridge.pool') @@ -46,17 +47,6 @@ vars:new('options', { apply_config_timeout = 10, }) -local function get_ddl_manager() - local ddl_manager - local ok, _ = pcall(require, 'ddl-ee') - if not ok then - ddl_manager = service_registry.get('ddl-manager') - else - ddl_manager = service_registry.get('ddl-manager-ee') - end - return ddl_manager -end - local function release_config_lock() local prepared_config = vars.prepared_config vars.prepared_config = nil @@ -800,7 +790,7 @@ local function get_schema() ) end - local ddl_manager = assert(get_ddl_manager()) + local ddl_manager = assert(service_registry.get('ddl-manager')) return ddl_manager.get_clusterwide_schema_yaml() end @@ -820,7 +810,7 @@ local function set_schema(schema_yml) ) end - local ddl_manager = assert(get_ddl_manager()) + local ddl_manager = assert(service_registry.get('ddl-manager')) local ok, err = ddl_manager.set_clusterwide_schema_yaml(schema_yml) if ok == nil then return nil, err diff --git a/cartridge/utils.lua b/cartridge/utils.lua index 550823fb1..a384e6817 100644 --- a/cartridge/utils.lua +++ b/cartridge/utils.lua @@ -14,10 +14,7 @@ local digest = require('digest') local tarantool = require('tarantool') -local ok, semver = pcall(require, 'vshard-ee.version') -if not ok then - semver = require('vshard.version') -end +local semver = require('vshard.version') local FcntlError = errors.new_class('FcntlError') local OpenFileError = errors.new_class('OpenFileError') diff --git a/cartridge/vshard-utils.lua b/cartridge/vshard-utils.lua index b754c66b3..d42cb7713 100644 --- a/cartridge/vshard-utils.lua +++ b/cartridge/vshard-utils.lua @@ -14,10 +14,7 @@ local failover = require('cartridge.failover') local twophase = require('cartridge.twophase') local confapplier = require('cartridge.confapplier') -local ok, vshard_consts = pcall(require, 'vshard-ee.consts') -if not ok then - vshard_consts = require('vshard.consts') -end +local vshard_consts = require('vshard.consts') local ValidateConfigError = errors.new_class('ValidateConfigError') diff --git a/cartridge/webui/api-config.lua b/cartridge/webui/api-config.lua index 7fc1d05e5..ea2cb42a5 100644 --- a/cartridge/webui/api-config.lua +++ b/cartridge/webui/api-config.lua @@ -286,13 +286,7 @@ local function validate_config(_, args) -- confapplier.validate_config as well but only for leaders. The -- following is used to perform the validation on non-leader instances. if patch['schema.yml'] and not require('cartridge.failover').is_leader() then - local ddl_manager - local ok, _ = pcall(require, 'ddl-ee') - if not ok then - ddl_manager = assert(service_registry.get('ddl-manager')) - else - ddl_manager = assert(service_registry.get('ddl-manager-ee')) - end + local ddl_manager = assert(service_registry.get('ddl-manager')) local ok, err = ddl_manager.check_schema_yaml(args.as_yaml) if not ok then if err.class_name == ddl_manager.CheckSchemaError.name then diff --git a/cartridge/webui/api-ddl.lua b/cartridge/webui/api-ddl.lua index d9c0c0786..4cf9bf57f 100644 --- a/cartridge/webui/api-ddl.lua +++ b/cartridge/webui/api-ddl.lua @@ -1,4 +1,5 @@ local errors = require('errors') +local ddl = require('ddl') local gql_types = require('graphql.types') local confapplier = require('cartridge.confapplier') @@ -8,17 +9,6 @@ local module_name = 'cartridge.webui.api-ddl' local GetSchemaError = errors.new_class('GetSchemaError') local CheckSchemaError = errors.new_class('CheckSchemaError') -local function get_ddl_manager() - local ddl_manager - local ok, _ = pcall(require, 'ddl-ee') - if not ok then - ddl_manager = service_registry.get('ddl-manager') - else - ddl_manager = service_registry.get('ddl-manager-ee') - end - return ddl_manager -end - local gql_type_schema = gql_types.object({ name = 'DDLSchema', description = 'The schema', @@ -46,7 +36,7 @@ local function graphql_get_schema() ) end - local ddl_manager = assert(get_ddl_manager()) + local ddl_manager = assert(service_registry.get('ddl-manager')) return {as_yaml = ddl_manager.get_clusterwide_schema_yaml()} end @@ -57,7 +47,7 @@ local function graphql_set_schema(_, args) ) end - local ddl_manager = assert(get_ddl_manager()) + local ddl_manager = assert(service_registry.get('ddl-manager')) local ok, err = ddl_manager.set_clusterwide_schema_yaml(args.as_yaml) if ok == nil then return nil, err @@ -73,7 +63,7 @@ local function graphql_check_schema(_, args) ) end - local ddl_manager = assert(get_ddl_manager()) + local ddl_manager = assert(service_registry.get('ddl-manager')) local ok, err = ddl_manager.check_schema_yaml(args.as_yaml) if ok then return { error = box.NULL }