Skip to content

Commit

Permalink
Fix typo in enable_synchro_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
yngvar-antonsson committed Jul 31, 2023
1 parent f3002f2 commit de07c4e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ Fixed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Fix operation priority in Raft failover.
- Typo in ``cartridge.cfg`` option ``enable_synchro_mode``.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Deprecated
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- ``cartridge.cfg`` option ``enable_sychro_mode``. Use ``enable_synchro_mode``
instead.

-------------------------------------------------------------------------------
[2.8.1] - 2023-07-20
Expand Down
8 changes: 7 additions & 1 deletion cartridge.lua
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ local function cfg(opts, box_opts)
upload_prefix = '?string',
enable_failover_suppressing = '?boolean',
enable_sychro_mode = '?boolean',
enable_synchro_mode = '?boolean',

transport = '?string',
ssl_ciphers = '?string',
Expand All @@ -316,6 +317,11 @@ local function cfg(opts, box_opts)
disable_errstack = '?boolean',
}, '?table')

if opts.enable_sychro_mode ~= nil then
opts.enable_synchro_mode = opts.enable_sychro_mode
log.warn('enable_sychro_mode is deprecated. Use enable_synchro_mode instead')
end

if opts.webui_blacklist ~= nil then
local i = 0
for _, _ in pairs(opts.webui_blacklist) do
Expand Down Expand Up @@ -875,7 +881,7 @@ local function cfg(opts, box_opts)
advertise_uri = advertise_uri,
upgrade_schema = opts.upgrade_schema,
enable_failover_suppressing = opts.enable_failover_suppressing,
enable_sychro_mode = opts.enable_sychro_mode,
enable_synchro_mode = opts.enable_synchro_mode,

transport = opts.transport,
ssl_ciphers = opts.ssl_ciphers,
Expand Down
8 changes: 4 additions & 4 deletions cartridge/confapplier.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ vars:new('box_opts', nil)
vars:new('upgrade_schema', nil)

vars:new('enable_failover_suppressing', nil)
vars:new('enable_sychro_mode', nil)
vars:new('enable_synchro_mode', nil)

vars:new('transport', nil)
vars:new('ssl_options', {
Expand Down Expand Up @@ -312,7 +312,7 @@ local function apply_config(clusterwide_config)
clusterwide_config,
{
enable_failover_suppressing = vars.enable_failover_suppressing,
enable_sychro_mode = vars.enable_sychro_mode,
enable_synchro_mode = vars.enable_synchro_mode,
}
)
if not ok then
Expand Down Expand Up @@ -776,7 +776,7 @@ local function init(opts)
advertise_uri = 'string',
upgrade_schema = '?boolean',
enable_failover_suppressing = '?boolean',
enable_sychro_mode = '?boolean',
enable_synchro_mode = '?boolean',

transport = '?string',
ssl_ciphers = '?string',
Expand All @@ -798,7 +798,7 @@ local function init(opts)
vars.advertise_uri = opts.advertise_uri
vars.upgrade_schema = opts.upgrade_schema
vars.enable_failover_suppressing = opts.enable_failover_suppressing
vars.enable_sychro_mode = opts.enable_sychro_mode
vars.enable_synchro_mode = opts.enable_synchro_mode
vars.transport = opts.transport
vars.ssl_ciphers = opts.ssl_ciphers
vars.ssl_server_ca_file = opts.ssl_server_ca_file
Expand Down
6 changes: 3 additions & 3 deletions cartridge/failover.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ vars:new('clusterwide_config')
vars:new('failover_fiber')
vars:new('failover_err')
vars:new('cookie_check_err', nil)
vars:new('enable_sychro_mode', false)
vars:new('enable_synchro_mode', false)
vars:new('schedule', {})
vars:new('client')
vars:new('cache', {
Expand Down Expand Up @@ -422,7 +422,7 @@ local function fencing_start()
end

local function synchro_promote()
if vars.enable_sychro_mode == true
if vars.enable_synchro_mode == true
and vars.mode == 'stateful'
and vars.consistency_needed
and vars.cache.is_leader
Expand Down Expand Up @@ -755,7 +755,7 @@ local function cfg(clusterwide_config, opts)
vars.suppress_fiber:name('cartridge.suppress_failover')
end

vars.enable_sychro_mode = opts.enable_sychro_mode
vars.enable_synchro_mode = opts.enable_synchro_mode

fencing_cancel()
leader_autoreturn.cancel()
Expand Down
2 changes: 1 addition & 1 deletion test/entrypoint/srv_basic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ local ok, err = errors.pcall('CartridgeCfgError', cartridge.cfg, {
webui_blacklist = webui_blacklist,
roles_reload_allowed = roles_reload_allowed,
enable_failover_suppressing = enable_failover_suppressing,
enable_sychro_mode = enable_synchro_mode,
enable_synchro_mode = enable_synchro_mode,
-- Compatibility tests run on cartridge 1.2.0
-- which doesn't support it yet.
upload_prefix = package.loaded['cartridge.upload'] and '../upload',
Expand Down
2 changes: 1 addition & 1 deletion test/entrypoint/srv_raft.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local ok, err = errors.pcall('CartridgeCfgError', cartridge.cfg, {
'test.roles.api',
'test.roles.storage',
},
enable_sychro_mode = true,
enable_synchro_mode = true,
},
{
log = '',
Expand Down

0 comments on commit de07c4e

Please sign in to comment.