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

Do not compile wsrep_provider plugin if WITH_WSREP is not enabled.
We should not enable wsrep_provider plugin if WSREP_ON=OFF and
at that case we can only print information that Plugin
'wsrep-provider' is disabled.

Make sure tests require Galera library 26.4.14 if needed.
This commit is contained in:
Jan Lindström 2023-01-03 12:18:38 +02:00 committed by Sergei Golubchik
parent 00f202b22a
commit 2988db1cd9
10 changed files with 126 additions and 106 deletions

View file

@ -1,3 +1,4 @@
# Correct Galera library found
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_repl_max_ws_size=1;
SHOW VARIABLES LIKE 'wsrep_provider_repl_max_ws_size';

View file

@ -1,3 +1,4 @@
# Correct Galera library found
select variable_type, global_value from information_schema.system_variables where variable_name = 'wsrep_provider_socket_recv_buf_size';
variable_type global_value
VARCHAR auto

View file

@ -1,6 +1,7 @@
# Correct Galera library found
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_provider%';
COUNT(*)
90
89
SELECT * FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES
WHERE VARIABLE_NAME LIKE 'wsrep_provider_%' AND VARIABLE_NAME NOT IN (
'wsrep_provider',
@ -87,14 +88,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_EVS_CAUSAL_KEEPALIVE_PERIOD
SESSION_VALUE NULL
GLOBAL_VALUE PT1S
GLOBAL_VALUE 1.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT1S
DEFAULT_VALUE 1.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
@ -117,14 +118,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_EVS_DELAYED_KEEP_PERIOD
SESSION_VALUE NULL
GLOBAL_VALUE PT30S
GLOBAL_VALUE 30.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT30S
DEFAULT_VALUE 30.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
@ -132,14 +133,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_EVS_DELAY_MARGIN
SESSION_VALUE NULL
GLOBAL_VALUE PT1S
GLOBAL_VALUE 1.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT1S
DEFAULT_VALUE 1.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
@ -162,14 +163,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_EVS_INACTIVE_CHECK_PERIOD
SESSION_VALUE NULL
GLOBAL_VALUE PT0.5S
GLOBAL_VALUE 0.500000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT0.5S
DEFAULT_VALUE 0.500000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
@ -177,14 +178,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_EVS_INACTIVE_TIMEOUT
SESSION_VALUE NULL
GLOBAL_VALUE PT15S
GLOBAL_VALUE 15.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT15S
DEFAULT_VALUE 15.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
@ -207,14 +208,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_EVS_INSTALL_TIMEOUT
SESSION_VALUE NULL
GLOBAL_VALUE PT7.5S
GLOBAL_VALUE 7.500000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT7.5S
DEFAULT_VALUE 7.500000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
@ -222,14 +223,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_EVS_JOIN_RETRANS_PERIOD
SESSION_VALUE NULL
GLOBAL_VALUE PT1S
GLOBAL_VALUE 1.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT1S
DEFAULT_VALUE 1.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
@ -237,14 +238,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_EVS_KEEPALIVE_PERIOD
SESSION_VALUE NULL
GLOBAL_VALUE PT1S
GLOBAL_VALUE 1.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT1S
DEFAULT_VALUE 1.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
@ -282,14 +283,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_EVS_STATS_REPORT_PERIOD
SESSION_VALUE NULL
GLOBAL_VALUE PT1M
GLOBAL_VALUE 60.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT1M
DEFAULT_VALUE 60.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
@ -297,14 +298,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_EVS_SUSPECT_TIMEOUT
SESSION_VALUE NULL
GLOBAL_VALUE PT5S
GLOBAL_VALUE 5.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT5S
DEFAULT_VALUE 5.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
@ -357,14 +358,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_EVS_VIEW_FORGET_TIMEOUT
SESSION_VALUE NULL
GLOBAL_VALUE P1D
GLOBAL_VALUE 86400.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE P1D
DEFAULT_VALUE 86400.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
@ -717,14 +718,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_GMCAST_PEER_TIMEOUT
SESSION_VALUE NULL
GLOBAL_VALUE PT3S
GLOBAL_VALUE 3.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT3S
DEFAULT_VALUE 3.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
@ -747,14 +748,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_GMCAST_TIME_WAIT
SESSION_VALUE NULL
GLOBAL_VALUE PT5S
GLOBAL_VALUE 5.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT5S
DEFAULT_VALUE 5.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
@ -807,14 +808,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_PC_ANNOUNCE_TIMEOUT
SESSION_VALUE NULL
GLOBAL_VALUE PT3S
GLOBAL_VALUE 3.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT3S
DEFAULT_VALUE 3.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
@ -882,14 +883,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_PC_LINGER
SESSION_VALUE NULL
GLOBAL_VALUE PT20S
GLOBAL_VALUE 20.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT20S
DEFAULT_VALUE 20.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
@ -957,14 +958,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_PC_WAIT_PRIM_TIMEOUT
SESSION_VALUE NULL
GLOBAL_VALUE PT30S
GLOBAL_VALUE 30.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT30S
DEFAULT_VALUE 30.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
@ -985,21 +986,6 @@ ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_PROTONET_BACKEND
SESSION_VALUE NULL
GLOBAL_VALUE asio
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE asio
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_PROTONET_VERSION
SESSION_VALUE NULL
GLOBAL_VALUE 0
@ -1017,14 +1003,14 @@ COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_PROVIDER_REPL_CAUSAL_READ_TIMEOUT
SESSION_VALUE NULL
GLOBAL_VALUE PT30S
GLOBAL_VALUE 30.000000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE PT30S
DEFAULT_VALUE 30.000000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Wsrep provider option
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_MIN_VALUE 2.2250738585072e-308
NUMERIC_MAX_VALUE 1.797693134862316e308
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO

View file

@ -0,0 +1,5 @@
SELECT @@wsrep_on;
@@wsrep_on
0
select variable_type, global_value from information_schema.system_variables where variable_name = 'wsrep_provider%';
variable_type global_value

View file

@ -6,6 +6,9 @@
--source include/have_wsrep.inc
--source include/have_innodb.inc
--let $galera_version=26.4.14
source include/check_galera_version.inc;
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_repl_max_ws_size=1;

View file

@ -1,6 +1,8 @@
--source include/have_wsrep.inc
--source include/have_innodb.inc
--let $galera_version=26.4.14
source include/check_galera_version.inc;
#
# Test string option

View file

@ -1,6 +1,9 @@
--source include/have_wsrep.inc
--source include/have_innodb.inc
--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%';
--vertical_results

View file

@ -0,0 +1,12 @@
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
[mysqld]
wsrep-on=OFF
[mysqld.1]
wsrep-on=OFF
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
plugin-wsrep-provider=ON

View file

@ -0,0 +1,6 @@
--source include/have_wsrep.inc
--source include/have_innodb.inc
SELECT @@wsrep_on;
select variable_type, global_value from information_schema.system_variables where variable_name = 'wsrep_provider%';

View file

@ -34,6 +34,7 @@
#include "wsrep_server_state.h"
#include "wsrep_var.h" // wsrep_refresh_provider_options()
#ifdef WITH_WSREP
static bool provider_plugin_enabled= false;
/* Prototype for provider system variables */
@ -277,12 +278,10 @@ static int wsrep_provider_plugin_init(void *p)
{
WSREP_DEBUG("wsrep_provider_plugin_init()");
if (!WSREP_ON_ || !wsrep_provider ||
(wsrep_provider && !strncasecmp(wsrep_provider, WSREP_NONE, FN_REFLEN)))
if (!WSREP_ON)
{
WSREP_ERROR("plugin-wsrep-provider can't be enabled if wsrep_on==OFF or wsrep_provider is unset or set to 'none'");
my_message(ER_WRONG_ARGUMENTS, "plugin-wsrep-provider can't be enabled if wsrep_on==OFF or wsrep_provider is unset or set to 'none'", MYF(0));
return 1;
sql_print_information("Plugin '%s' is disabled.", "wsrep-provider");
return 0;
}
provider_plugin_enabled= true;
@ -369,3 +368,5 @@ maria_declare_plugin(wsrep)
MariaDB_PLUGIN_MATURITY_STABLE /* Maturity */
}
maria_declare_plugin_end;
#endif /* WITH_WSREP */