Skip to content
Snippets Groups Projects
Commit c041863d authored by Serge Petrenko's avatar Serge Petrenko Committed by Alexander Turenko
Browse files

config: fix automatic names apply before schema upgrade

Each config reload on a node with old schema (less than 3.0.0) lead to
the error ER_SCHEMA_NEEDS_UPGRADE. This happened because the relevant
code didn't check for schema version before trying to apply the names.

Fix this.

Closes #9502

NO_DOC=bugfix
NO_CHANGELOG=fix in a not yet released behavior
parent c3ef0c57
No related branches found
No related tags found
No related merge requests found
......@@ -283,7 +283,9 @@ local function names_apply(config, missing_names, schema_version)
names_alert_missing(config, missing_names)
-- Don't wait for box.status to change, we may be already rw, set names
-- on reload, if it's possible and needed.
names_try_set_missing()
if schema_version and schema_version >= mkversion.get_latest() then
names_try_set_missing()
end
if names_state.is_configured then
-- All triggers are already configured, nothing to do, but wait.
......
......@@ -96,6 +96,12 @@ local function assert_before_upgrade()
local info = box.info
t.assert_equals(info.name, nil)
t.assert_equals(info.replicaset.name, nil)
-- Check that config:reload() respects old schema version.
local config = require('config')
config:reload()
info = box.info
t.assert_equals(info.name, nil)
t.assert_equals(info.replicaset.name, nil)
end
local function assert_after_upgrade(instance_name, replicaset_name, names)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment