Skip to content

Commit debfff7

Browse files
author
Omar Sharieff
committed
Bug#35398028 : crash when persisted GR variable exist and
GR plugin isn't loaded (during upgrade) Description: Server crashes on start up if the group replication plugin is disabled or uninstalled after upgrade from version 8.0.28 in which group replication variables were persisted. Server does not load certain persisted group replication variables when the plugin is installed after server start up. Fix: Handled the case of nullptr return value. Added functionality to load parse early variables during plugin installation. Change-Id: I04a96c8435f77e187648b7e5a9cc88cecaacd4f0
1 parent 8d35691 commit debfff7

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

sql/persisted_variable.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,9 @@ void Persisted_variables_cache::set_parse_early_sources() {
897897

898898
for (auto &it : sorted_vars) {
899899
auto sysvar = intern_find_sys_var(it.key.c_str(), it.key.length());
900+
if (sysvar == nullptr) {
901+
continue;
902+
}
900903
sysvar->set_source(enum_variable_source::PERSISTED);
901904
#ifndef NDEBUG
902905
bool source_truncated =
@@ -1961,8 +1964,8 @@ int Persisted_variables_cache::read_persist_file() {
19611964

19621965
/**
19631966
append_parse_early_variables() does a lookup into persist_variables
1964-
for read only variables and place them after the command line options with a
1965-
separator "----persist-args-separator----"
1967+
for parse early variables and place them after the command line options with
1968+
a separator "----persist-args-separator----"
19661969
19671970
This function does nothing when --no-defaults is set or if
19681971
persisted_globals_load is disabled.

sql/sql_plugin.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2337,11 +2337,15 @@ static bool mysql_install_plugin(THD *thd, LEX_CSTRING name,
23372337
}
23382338
my_getopt_use_args_separator = false;
23392339
/*
2340-
Append static variables present in mysqld-auto.cnf file for the
2341-
newly installed plugin to process those options which are specific
2340+
Append parse early and static variables present in mysqld-auto.cnf file
2341+
for the newly installed plugin to process those options which are specific
23422342
to this plugin.
23432343
*/
2344-
if (pv && pv->append_read_only_variables(&argc, &argv, false, true)) {
2344+
bool arg_separator_added = false;
2345+
if (pv &&
2346+
(pv->append_parse_early_variables(&argc, &argv, arg_separator_added) ||
2347+
pv->append_read_only_variables(&argc, &argv, arg_separator_added,
2348+
true))) {
23452349
mysql_mutex_unlock(&LOCK_plugin);
23462350
mysql_rwlock_unlock(&LOCK_system_variables_hash);
23472351
report_error(REPORT_TO_USER, ER_PLUGIN_IS_NOT_LOADED, name.str);

0 commit comments

Comments
 (0)