MDEV-30318: galera error messages in mariadb log without galera enabled

Post-fix to MDEV-30318 and MDEV-22570-related changes:
unified handling of wsrep_provider by code so that "none"
is interpreted as case-insensitive everywhere and that
work with an empty string is supported everywhere.
This commit is contained in:
Julius Goryavsky 2023-02-15 14:38:28 +01:00
parent cc182aca93
commit 80b4fa54e1
8 changed files with 45 additions and 15 deletions

View file

@ -1,6 +1,6 @@
--disable_query_log
--let $galera_variables_ok = `SELECT COUNT(*) = 50 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep%'`
--let $galera_variables_ok = `SELECT COUNT(*) = 51 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep%'`
--if (!$galera_variables_ok) {
--skip Galera number of variables has changed!

View file

@ -1,7 +1,16 @@
# Correct Galera library found
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_provider%';
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_provider%' AND VARIABLE_NAME NOT IN (
'wsrep_provider',
'wsrep_provider_options',
'wsrep_provider_base_dir',
'wsrep_provider_base_port',
'wsrep_provider_gcache_dir',
'wsrep_provider_dbug',
'wsrep_provider_gcache_debug',
'wsrep_provider_signal',
'wsrep_provider_gmcast_listen_addr');
COUNT(*)
89
83
SELECT * FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES
WHERE VARIABLE_NAME LIKE 'wsrep_provider_%' AND VARIABLE_NAME NOT IN (
'wsrep_provider',
@ -9,6 +18,9 @@ WHERE VARIABLE_NAME LIKE 'wsrep_provider_%' AND VARIABLE_NAME NOT IN (
'wsrep_provider_base_dir',
'wsrep_provider_base_port',
'wsrep_provider_gcache_dir',
'wsrep_provider_dbug',
'wsrep_provider_gcache_debug',
'wsrep_provider_signal',
'wsrep_provider_gmcast_listen_addr')
ORDER BY VARIABLE_NAME;
VARIABLE_NAME WSREP_PROVIDER_BASE_HOST

View file

@ -8,7 +8,7 @@
--let $galera_version=26.4.11
source include/check_galera_version.inc;
source include/galera_variables_ok.inc;
source include/galera_variables_ok_debug.inc;
--replace_column 2 #
SHOW GLOBAL STATUS LIKE 'wsrep%';

View file

@ -4,7 +4,16 @@
--let $galera_version=26.4.14
source include/check_galera_version.inc;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_provider%';
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_provider%' AND VARIABLE_NAME NOT IN (
'wsrep_provider',
'wsrep_provider_options',
'wsrep_provider_base_dir',
'wsrep_provider_base_port',
'wsrep_provider_gcache_dir',
'wsrep_provider_dbug',
'wsrep_provider_gcache_debug',
'wsrep_provider_signal',
'wsrep_provider_gmcast_listen_addr');
--vertical_results
SELECT * FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES
@ -14,5 +23,8 @@ WHERE VARIABLE_NAME LIKE 'wsrep_provider_%' AND VARIABLE_NAME NOT IN (
'wsrep_provider_base_dir',
'wsrep_provider_base_port',
'wsrep_provider_gcache_dir',
'wsrep_provider_dbug',
'wsrep_provider_gcache_debug',
'wsrep_provider_signal',
'wsrep_provider_gmcast_listen_addr')
ORDER BY VARIABLE_NAME;

View file

@ -85,7 +85,7 @@ int wsrep_check_opts()
}
}
if (strcasecmp(wsrep_provider, "NONE"))
if (strcasecmp(wsrep_provider, WSREP_NONE))
{
if (global_system_variables.binlog_format != BINLOG_FORMAT_ROW)
{

View file

@ -867,8 +867,8 @@ int wsrep_init()
wsrep_init_position();
wsrep_sst_auth_init();
if (strlen(wsrep_provider)== 0 ||
!strcmp(wsrep_provider, WSREP_NONE))
if (!*wsrep_provider ||
!strcasecmp(wsrep_provider, WSREP_NONE))
{
// enable normal operation in case no provider is specified
global_system_variables.wsrep_on= 0;
@ -922,7 +922,7 @@ int wsrep_init()
/* Now WSREP is fully initialized */
global_system_variables.wsrep_on= 1;
WSREP_ON_= wsrep_provider && strcmp(wsrep_provider, WSREP_NONE);
WSREP_ON_= wsrep_provider && *wsrep_provider && strcasecmp(wsrep_provider, WSREP_NONE);
wsrep_service_started= 1;
wsrep_init_provider_status_variables();
@ -991,7 +991,8 @@ void wsrep_init_startup (bool sst_first)
wsrep_plugins_pre_init();
/* Skip replication start if dummy wsrep provider is loaded */
if (!strcmp(wsrep_provider, WSREP_NONE)) return;
if (!wsrep_provider || !*wsrep_provider ||
!strcasecmp(wsrep_provider, WSREP_NONE)) return;
/* Skip replication start if no cluster address */
if (!wsrep_cluster_address_exists()) return;

View file

@ -310,7 +310,8 @@ bool wsrep_sst_donor_update (sys_var *self, THD* thd, enum_var_type type)
bool wsrep_before_SE()
{
return (wsrep_provider != NULL
return (wsrep_provider
&& *wsrep_provider
&& strcmp (wsrep_provider, WSREP_NONE)
&& strcmp (wsrep_sst_method, WSREP_SST_SKIP)
&& strcmp (wsrep_sst_method, WSREP_SST_MYSQLDUMP));

View file

@ -103,8 +103,8 @@ void wsrep_set_wsrep_on(THD* thd)
{
if (thd)
thd->wsrep_was_on= WSREP_ON_;
WSREP_PROVIDER_EXISTS_= wsrep_provider &&
strncasecmp(wsrep_provider, WSREP_NONE, FN_REFLEN);
WSREP_PROVIDER_EXISTS_= wsrep_provider && *wsrep_provider &&
strcasecmp(wsrep_provider, WSREP_NONE);
WSREP_ON_= global_system_variables.wsrep_on && WSREP_PROVIDER_EXISTS_;
}
@ -114,10 +114,14 @@ bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type)
{
my_bool saved_wsrep_on= global_system_variables.wsrep_on;
thd->variables.wsrep_on= global_system_variables.wsrep_on;
thd->variables.wsrep_on= saved_wsrep_on;
// If wsrep has not been inited we need to do it now
if (global_system_variables.wsrep_on && wsrep_provider && !wsrep_inited)
if (!wsrep_inited &&
saved_wsrep_on &&
wsrep_provider &&
*wsrep_provider &&
strcasecmp(wsrep_provider, WSREP_NONE))
{
// wsrep_init() rewrites provide if it fails
char* tmp= strdup(wsrep_provider);