Skip to content

Commit

Permalink
Remove vshard-ee and ddl-ee
Browse files Browse the repository at this point in the history
  • Loading branch information
yngvar-antonsson committed Jul 10, 2024
1 parent ca53ded commit c7688b1
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 75 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ Fixed

- Last instance in vshard-storage replicaset can be expelled now.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
-------------------------------------------------------------------------------
Expand Down
22 changes: 5 additions & 17 deletions cartridge/lua-api/boxinfo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -51,24 +54,9 @@ 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 vshard = require('vshard')

local routers = vshard and vshard.router.internal.routers or {}
local routers = vshard.router.internal.routers or {}
local router_info = {}
if next(routers) ~= nil then
for group, router in pairs(routers) do
Expand Down
9 changes: 1 addition & 8 deletions cartridge/roles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}

Expand Down
5 changes: 1 addition & 4 deletions cartridge/roles/vshard-router.lua
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
5 changes: 1 addition & 4 deletions cartridge/roles/vshard-storage.lua
Original file line number Diff line number Diff line change
@@ -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')

Expand Down
15 changes: 2 additions & 13 deletions cartridge/twophase.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,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
Expand Down Expand Up @@ -800,7 +789,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

Expand All @@ -820,7 +809,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
Expand Down
5 changes: 1 addition & 4 deletions cartridge/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
5 changes: 1 addition & 4 deletions cartridge/vshard-utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ local twophase = require('cartridge.twophase')
local confapplier = require('cartridge.confapplier')
local rpc = require('cartridge.rpc')

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')

Expand Down
8 changes: 1 addition & 7 deletions cartridge/webui/api-config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 3 additions & 14 deletions cartridge/webui/api-ddl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,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',
Expand Down Expand Up @@ -46,7 +35,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

Expand All @@ -57,7 +46,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
Expand All @@ -73,7 +62,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 }
Expand Down

0 comments on commit c7688b1

Please sign in to comment.