diff --git a/.github/workflows/compatibility-test.yml b/.github/workflows/compatibility-test.yml index dc35187dd..104c201d7 100644 --- a/.github/workflows/compatibility-test.yml +++ b/.github/workflows/compatibility-test.yml @@ -21,16 +21,10 @@ jobs: downgrade: [null] include: - tarantool: '1.10' - cartridge: '2.7.9' - downgrade: true - - tarantool: '1.10' - cartridge: '2.8.4' - downgrade: true - - tarantool: '2.10' - cartridge: '2.7.9' + cartridge: '2.8.6' downgrade: true - tarantool: '2.10' - cartridge: '2.8.4' + cartridge: '2.8.6' downgrade: true runs-on: ubuntu-20.04 env: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6dc35a6fe..0bfd2817d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -12,6 +12,13 @@ and this project adheres to Unreleased ------------------------------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Added +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- New VShard configuration options: ``rebalancer`` and + ``rebalancer_mode``. + ------------------------------------------------------------------------------- [2.8.6] - 2024-02-01 ------------------------------------------------------------------------------- diff --git a/cartridge/vshard-utils.lua b/cartridge/vshard-utils.lua index 94890f064..157b61169 100644 --- a/cartridge/vshard-utils.lua +++ b/cartridge/vshard-utils.lua @@ -30,6 +30,8 @@ vars:new('known_groups', nil -- rebalancer_disbalance_threshold = number, -- sched_ref_quota = number, -- sched_move_quota = number, + -- rebalancer = boolean, + -- rebalancer_mode = string, -- } --} ) @@ -228,6 +230,26 @@ local function validate_vshard_group(field, vsgroup_new, vsgroup_old) '%s.rebalancer_disbalance_threshold must be non-negative', field ) end + + if vsgroup_new.rebalancer ~= nil then + ValidateConfigError:assert( + type(vsgroup_new.rebalancer) == 'boolean', + '%s.rebalancer must be a boolean', field + ) + end + + if vsgroup_new.rebalancer_mode ~= nil then + ValidateConfigError:assert( + type(vsgroup_new.rebalancer_mode) == 'string' + and ( + vsgroup_new.rebalancer_mode == 'auto' + or vsgroup_new.rebalancer_mode == 'manual' + or vsgroup_new.rebalancer_mode == 'off' + ), + '%s.rebalancer must be one of: "auto", "manual", "off"', field + ) + end + if vsgroup_new.sched_ref_quota ~= nil then ValidateConfigError:assert( type(vsgroup_new.sched_ref_quota) == 'number', @@ -267,6 +289,8 @@ local function validate_vshard_group(field, vsgroup_new, vsgroup_old) ['sync_timeout'] = true, ['collect_bucket_garbage_interval'] = true, ['rebalancer_disbalance_threshold'] = true, + ['rebalancer'] = true, + ['rebalancer_mode'] = true, ['sched_ref_quota'] = true, ['sched_move_quota'] = true, } @@ -438,6 +462,15 @@ local function get_known_groups() g.rebalancer_disbalance_threshold = vshard_consts.DEFAULT_REBALANCER_DISBALANCE_THRESHOLD end + -- just for the code consistancy + if g.rebalancer == nil then + g.rebalancer = nil + end + + if g.rebalancer_mode == nil then + g.rebalancer_mode = 'auto' + end + if g.sched_ref_quota == nil then g.sched_ref_quota = vshard_consts.DEFAULT_SCHED_REF_QUOTA end @@ -555,6 +588,8 @@ local function get_vshard_config(group_name, conf) sync_timeout = vshard_groups[group_name].sync_timeout, collect_bucket_garbage_interval = vshard_groups[group_name].collect_bucket_garbage_interval, rebalancer_disbalance_threshold = vshard_groups[group_name].rebalancer_disbalance_threshold, + rebalancer = vshard_groups[group_name].rebalancer, + rebalancer_mode = vshard_groups[group_name].rebalancer_mode, sharding = sharding, read_only = not failover.is_rw(), weights = zone_distances, @@ -614,6 +649,8 @@ local function edit_vshard_options(group_name, vshard_options) sync_timeout = '?number', collect_bucket_garbage_interval = '?number', rebalancer_disbalance_threshold = '?number', + rebalancer = '?boolean', + rebalancer_mode = '?string', sched_ref_quota = '?number', sched_move_quota = '?number', } diff --git a/cartridge/webui/api-vshard.lua b/cartridge/webui/api-vshard.lua index 17788795e..9f78fb515 100644 --- a/cartridge/webui/api-vshard.lua +++ b/cartridge/webui/api-vshard.lua @@ -49,6 +49,14 @@ local gql_type_vsgroup = gql_types.object({ kind = gql_types.float.nonNull, description = 'A maximum bucket disbalance threshold, in percent' }, + rebalancer = { + kind = gql_types.boolean, + description = 'Run rebalancer on a specific replicaset' + }, + rebalancer_mode = { + kind = gql_types.string.nonNull, + description = 'Rebalancer mode' + }, sched_ref_quota = { kind = gql_types.long.nonNull, description = 'Scheduler storage ref quota' @@ -171,6 +179,8 @@ local function init(graphql) sync_timeout = gql_types.float, collect_bucket_garbage_interval = gql_types.float, rebalancer_disbalance_threshold = gql_types.float, + rebalancer = gql_types.boolean, + rebalancer_mode = gql_types.string, sched_ref_quota = gql_types.long, sched_move_quota = gql_types.long, }, diff --git a/doc/schema.graphql b/doc/schema.graphql index 32fa76f79..acb494650 100644 --- a/doc/schema.graphql +++ b/doc/schema.graphql @@ -1,5 +1,5 @@ # source: http://127.0.0.1:8081/admin/api -# timestamp: Fri Nov 03 2023 16:54:14 GMT+0300 (Moscow Standard Time) +# timestamp: Fri Feb 02 2024 17:36:46 GMT+0300 (Moscow Standard Time) """Custom scalar specification.""" directive @specifiedBy( @@ -457,16 +457,26 @@ type MutationApicluster { sched_ref_quota: Long """ - The `Int` scalar type represents non-fractional signed whole numeric values. - Int can represent values from -(2^31) to 2^31 - 1, inclusive. + The `String` scalar type represents textual data, represented as UTF-8 + character sequences. The String type is most often used by GraphQL to + represent free-form human-readable text. """ - rebalancer_max_sending: Int + rebalancer_mode: String + + """The `Boolean` scalar type represents `true` or `false`.""" + rebalancer: Boolean """ The `Float` scalar type represents signed double-precision fractional values as specified by IEEE 754. """ sync_timeout: Float + """ + The `Int` scalar type represents non-fractional signed whole numeric values. + Int can represent values from -(2^31) to 2^31 - 1, inclusive. + """ + rebalancer_max_sending: Int + """ The `Float` scalar type represents signed double-precision fractional values as specified by IEEE 754. """ @@ -1110,22 +1120,28 @@ type VshardGroup { """ collect_lua_garbage: Boolean @deprecated(reason: "Has no effect anymore") + """Scheduler storage ref quota""" + sched_ref_quota: Long! + + """Rebalancer mode""" + rebalancer_mode: String! + + """Run rebalancer on a specific replicaset""" + rebalancer: Boolean + """ Timeout to wait for synchronization of the old master with replicas before demotion """ sync_timeout: Float! - """Whether the group is ready to operate""" - bootstrapped: Boolean! - - """Scheduler storage ref quota""" - sched_ref_quota: Long! - """ The maximum number of buckets that can be sent in parallel by a single replica set in the storage group """ rebalancer_max_sending: Int! + """Whether the group is ready to operate""" + bootstrapped: Boolean! + """A maximum bucket disbalance threshold, in percent""" rebalancer_disbalance_threshold: Float! diff --git a/rst/cartridge_admin.rst b/rst/cartridge_admin.rst index 501825a12..45cc95944 100644 --- a/rst/cartridge_admin.rst +++ b/rst/cartridge_admin.rst @@ -28,7 +28,7 @@ Cartridge is compatible with Tarantool 1.10 and Tarantool 2.x. Cartridge doesn't support Tarantool 3.0 and higher. .. list-table:: Compatibility and known issues - :widths: 50 50 50 50 50 + :widths: 50 50 50 50 50 50 :header-rows: 1 :stub-columns: 1 @@ -37,91 +37,116 @@ Cartridge doesn't support Tarantool 3.0 and higher. - Tarantool 2.8 - Tarantool 2.10 - Tarantool 2.11 + - Additional notes + * - Cartridge scm-1 + - \+ + - \+ + - \+ + - \+ + - Can't be downgraded to Cartridge 2.7.9 and lower * - Cartridge 2.8.6 - \+ - \+ - \+ - \+ + - * - Cartridge 2.8.5 - \+ - \+ - \+ - \+ + - * - Cartridge 2.8.4 - \+ - \+ - \+ - \+ + - * - Cartridge 2.8.3 - \+ - \+ - \+ - \+ + - * - Cartridge 2.8.2 - \+ - \+ - \+ - \+ + - * - Cartridge 2.8.1 - \+ - \+ - \+ - \+ + - * - Cartridge 2.8.0 - \+ - \+ - \+ - \+ + - * - Cartridge 2.7.9 - \+ - \+ - \+ - \+ + - * - Cartridge 2.7.8 - - Update is broken - - Update is broken - - Update is broken - - Update is broken + - \+ + - \+ + - \+ + - \- + - Update to this release is broken * - Cartridge 2.7.7 - - Update is broken - - Update is broken - - Update is broken - - Update is broken + - \+ + - \+ + - \+ + - \- + - Update to this release is broken * - Cartridge 2.7.6 - - Update is broken - - Update is broken - - Update is broken - - Update is broken + - \+ + - \+ + - \+ + - \- + - Update to this release is broken * - Cartridge 2.7.5 - \+ - \+ - \+ - \- + - * - Cartridge 2.7.4 - \+ - \+ - \+ - \- + - * - Cartridge 2.7.3 - \+ - \+ - \- - \- + - * - Cartridge 2.7.2 - \+ - \+ - \- - \- + - * - Cartridge 2.7.1 - \+ - \+ - \- - \- + - * - Cartridge 2.7.0 - \+ - \+ - \- - \- + - Can't be downgraded to Cartridge 2.6.0 and lower + .. _cartridge-deployment: diff --git a/test/integration/vshard_api_test.lua b/test/integration/vshard_api_test.lua index 4d950a3ed..34a9641d4 100644 --- a/test/integration/vshard_api_test.lua +++ b/test/integration/vshard_api_test.lua @@ -43,6 +43,7 @@ function g.test_get_cfg() collect_lua_garbage = false, read_only = false, rebalancer_disbalance_threshold = 1, + rebalancer_mode = 'auto', rebalancer_max_receiving = 100, rebalancer_max_sending = 1, sched_move_quota = 1, @@ -122,6 +123,7 @@ function g.test_get_cfg_multisharding() collect_lua_garbage = false, read_only = false, rebalancer_disbalance_threshold = 1, + rebalancer_mode = 'auto', rebalancer_max_receiving = 100, rebalancer_max_sending = 1, sched_move_quota = 1, @@ -146,6 +148,7 @@ function g.test_get_cfg_multisharding() read_only = false, rebalancer_disbalance_threshold = 1, rebalancer_max_receiving = 100, + rebalancer_mode = 'auto', rebalancer_max_sending = 1, sched_move_quota = 1, sched_ref_quota = 300,