Commit 2988db1c authored by Jan Lindström's avatar Jan Lindström Committed by Sergei Golubchik

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.
parent 00f202b2
# Correct Galera library found
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_repl_max_ws_size=1; SET GLOBAL wsrep_provider_repl_max_ws_size=1;
SHOW VARIABLES LIKE 'wsrep_provider_repl_max_ws_size'; SHOW VARIABLES LIKE 'wsrep_provider_repl_max_ws_size';
......
# Correct Galera library found
select variable_type, global_value from information_schema.system_variables where variable_name = 'wsrep_provider_socket_recv_buf_size'; select variable_type, global_value from information_schema.system_variables where variable_name = 'wsrep_provider_socket_recv_buf_size';
variable_type global_value variable_type global_value
VARCHAR auto VARCHAR auto
......
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
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
--source include/have_wsrep.inc --source include/have_wsrep.inc
--source include/have_innodb.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; CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_repl_max_ws_size=1; SET GLOBAL wsrep_provider_repl_max_ws_size=1;
......
--source include/have_wsrep.inc --source include/have_wsrep.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--let $galera_version=26.4.14
source include/check_galera_version.inc;
# #
# Test string option # Test string option
......
--source include/have_wsrep.inc --source include/have_wsrep.inc
--source include/have_innodb.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%'; SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_provider%';
--vertical_results --vertical_results
......
# 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
--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%';
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "wsrep_server_state.h" #include "wsrep_server_state.h"
#include "wsrep_var.h" // wsrep_refresh_provider_options() #include "wsrep_var.h" // wsrep_refresh_provider_options()
#ifdef WITH_WSREP
static bool provider_plugin_enabled= false; static bool provider_plugin_enabled= false;
/* Prototype for provider system variables */ /* Prototype for provider system variables */
...@@ -277,12 +278,10 @@ static int wsrep_provider_plugin_init(void *p) ...@@ -277,12 +278,10 @@ static int wsrep_provider_plugin_init(void *p)
{ {
WSREP_DEBUG("wsrep_provider_plugin_init()"); WSREP_DEBUG("wsrep_provider_plugin_init()");
if (!WSREP_ON_ || !wsrep_provider || if (!WSREP_ON)
(wsrep_provider && !strncasecmp(wsrep_provider, WSREP_NONE, FN_REFLEN)))
{ {
WSREP_ERROR("plugin-wsrep-provider can't be enabled if wsrep_on==OFF or wsrep_provider is unset or set to 'none'"); sql_print_information("Plugin '%s' is disabled.", "wsrep-provider");
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 0;
return 1;
} }
provider_plugin_enabled= true; provider_plugin_enabled= true;
...@@ -369,3 +368,5 @@ maria_declare_plugin(wsrep) ...@@ -369,3 +368,5 @@ maria_declare_plugin(wsrep)
MariaDB_PLUGIN_MATURITY_STABLE /* Maturity */ MariaDB_PLUGIN_MATURITY_STABLE /* Maturity */
} }
maria_declare_plugin_end; maria_declare_plugin_end;
#endif /* WITH_WSREP */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment