Commit 6f50f51e authored by Jan Lindström's avatar Jan Lindström

MDEV-21494 : Galera test sporadic failure on galera.galera_defaults

Make sure that we operate with correct Galera library version
and do not print wsrep_provider_options field.
parent 60035bd2
...@@ -2,6 +2,7 @@ connection node_2; ...@@ -2,6 +2,7 @@ connection node_2;
connection node_1; connection node_1;
connection node_1; connection node_1;
SET SESSION wsrep_sync_wait=0; SET SESSION wsrep_sync_wait=0;
# Correct Galera library found
SET SESSION wsrep_sync_wait=DEFAULT; SET SESSION wsrep_sync_wait=DEFAULT;
SET GLOBAL wsrep_provider_options = 'pc.weight=3'; SET GLOBAL wsrep_provider_options = 'pc.weight=3';
SHOW GLOBAL VARIABLES LIKE 'wsrep_provider_options'; SHOW GLOBAL VARIABLES LIKE 'wsrep_provider_options';
......
connection node_2; connection node_2;
connection node_1; connection node_1;
SELECT COUNT(*) `expect 48` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%'; # Correct Galera library found
expect 48 SELECT COUNT(*) `expect 49` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
expect 49
49 49
SELECT VARIABLE_NAME, VARIABLE_VALUE SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
......
...@@ -5,12 +5,9 @@ ...@@ -5,12 +5,9 @@
--connection node_1 --connection node_1
SET SESSION wsrep_sync_wait=0; SET SESSION wsrep_sync_wait=0;
--disable_result_log
--disable_query_log
--let $galera_version=25.3.24 --let $galera_version=25.3.24
source ../../wsrep/include/check_galera_version.inc; source ../../wsrep/include/check_galera_version.inc;
--enable_result_log
--enable_query_log
SET SESSION wsrep_sync_wait=DEFAULT; SET SESSION wsrep_sync_wait=DEFAULT;
# Convert "... pc.weight = N; ..." to "N; ..." # Convert "... pc.weight = N; ..." to "N; ..."
......
!include ../galera_2nodes.cnf
[mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.segment=1'
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.segment=1'
# #
# The purpose of this test is to preserve the current state of the following: # The purpose of this test is to preserve the current state of the following:
# * SHOW VARIABLES LIKE 'wsrep%' # * SHOW VARIABLES LIKE 'wsrep%'
# * wsrep_provider_options
# * The names of the Galera status variables # * The names of the Galera status variables
# #
# Note that wsrep_provider_options contains paths and other non-deterministic parts
#
# This way, if there is any change, inadvertent or not, the test will fail and the # This way, if there is any change, inadvertent or not, the test will fail and the
# developer and QA will be alerted. # developer and QA will be alerted.
# #
--source include/galera_cluster.inc --source include/galera_cluster.inc
--source include/have_innodb.inc --source include/force_restart.inc
# Make sure that the test is operating on the right version of galera library. # Make sure that the test is operating on the right version of galera library.
--disable_query_log --let $galera_version=26.4.6
--let $galera_version=25.3.20
source ../wsrep/include/check_galera_version.inc; source ../wsrep/include/check_galera_version.inc;
--enable_query_log
# Global Variables # Global Variables
SELECT COUNT(*) `expect 48` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%'; SELECT COUNT(*) `expect 49` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
SELECT VARIABLE_NAME, VARIABLE_VALUE SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
......
...@@ -21,23 +21,27 @@ SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\3') ...@@ -21,23 +21,27 @@ SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\3')
# Actual # Actual
SELECT VARIABLE_VALUE INTO @ACTUAL_GALERA_VERSION FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep_provider_version'; SELECT VARIABLE_VALUE INTO @ACTUAL_GALERA_VERSION FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep_provider_version';
SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+).*','\\1') AS UNSIGNED) INTO @ACTUAL_GALERA_MAJOR_VERSION;
SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^[\\d\\.]*(\\d+)\\.\\d+.*','\\1') AS UNSIGNED) INTO @ACTUAL_GALERA_MINOR_VERSION; SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^[\\d\\.]*(\\d+)\\.\\d+.*','\\1') AS UNSIGNED) INTO @ACTUAL_GALERA_MINOR_VERSION;
SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^[\\d\\.]*\\.(\\d+).*','\\1') AS UNSIGNED) INTO @ACTUAL_GALERA_RELEASE_VERSION; SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^[\\d\\.]*\\.(\\d+).*','\\1') AS UNSIGNED) INTO @ACTUAL_GALERA_RELEASE_VERSION;
--enable_query_log
# For testing # For testing
#SELECT @GALERA_MAJOR_VERSION; #SELECT @GALERA_MAJOR_VERSION;
#SELECT @GALERA_MINOR_VERSION; #SELECT @GALERA_MINOR_VERSION;
#SELECT @GALERA_RELEASE_VERSION; #SELECT @GALERA_RELEASE_VERSION;
#SELECT @ACTUAL_GALERA_VERSION; #SELECT @ACTUAL_GALERA_MAJOR_VERSION;
#SELECT @ACTUAL_GALERA_MINOR_VERSION; #SELECT @ACTUAL_GALERA_MINOR_VERSION;
#SELECT @ACTUAL_GALERA_RELEASE_VERSION; #SELECT @ACTUAL_GALERA_RELEASE_VERSION;
if (!`SELECT (@ACTUAL_GALERA_MINOR_VERSION > @GALERA_MINOR_VERSION) OR if (!`SELECT (@ACTUAL_GALERA_MAJOR_VERSION >= @GALERA_MAJOR_VERSION AND @ACTUAL_GALERA_MINOR_VERSION > @GALERA_MINOR_VERSION) OR
(@ACTUAL_GALERA_MINOR_VERSION = @GALERA_MINOR_VERSION AND (@ACTUAL_GALERA_MAJOR_VERSION = @GALERA_MAJOR_VERSION AND
@ACTUAL_GALERA_MINOR_VERSION = @GALERA_MINOR_VERSION AND
@ACTUAL_GALERA_RELEASE_VERSION >= @GALERA_RELEASE_VERSION) @ACTUAL_GALERA_RELEASE_VERSION >= @GALERA_RELEASE_VERSION)
`) `)
{ {
skip Test requires Galera library version >= $galera_version; skip Test requires Galera library version >= $galera_version;
} }
--enable_query_log --echo # Correct Galera library found
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