From 6f50f51e60589c0db5e761c2793da09906d3d3a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 18 Nov 2020 14:21:12 +0200 Subject: 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. --- mysql-test/suite/galera/r/galera#505.result | 1 + mysql-test/suite/galera/r/galera_defaults.result | 5 +++-- mysql-test/suite/galera/t/galera#505.test | 5 +---- mysql-test/suite/galera/t/galera_defaults.cnf | 7 +++++++ mysql-test/suite/galera/t/galera_defaults.test | 11 +++++------ mysql-test/suite/wsrep/include/check_galera_version.inc | 12 ++++++++---- 6 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 mysql-test/suite/galera/t/galera_defaults.cnf (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/galera/r/galera#505.result b/mysql-test/suite/galera/r/galera#505.result index bc7eb3b9ed4..d5e78c570b5 100644 --- a/mysql-test/suite/galera/r/galera#505.result +++ b/mysql-test/suite/galera/r/galera#505.result @@ -2,6 +2,7 @@ connection node_2; connection node_1; connection node_1; SET SESSION wsrep_sync_wait=0; +# Correct Galera library found SET SESSION wsrep_sync_wait=DEFAULT; SET GLOBAL wsrep_provider_options = 'pc.weight=3'; SHOW GLOBAL VARIABLES LIKE 'wsrep_provider_options'; diff --git a/mysql-test/suite/galera/r/galera_defaults.result b/mysql-test/suite/galera/r/galera_defaults.result index 6dd5258ff6d..9a5c1e54b06 100644 --- a/mysql-test/suite/galera/r/galera_defaults.result +++ b/mysql-test/suite/galera/r/galera_defaults.result @@ -1,7 +1,8 @@ connection node_2; connection node_1; -SELECT COUNT(*) `expect 48` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%'; -expect 48 +# Correct Galera library found +SELECT COUNT(*) `expect 49` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%'; +expect 49 49 SELECT VARIABLE_NAME, VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES diff --git a/mysql-test/suite/galera/t/galera#505.test b/mysql-test/suite/galera/t/galera#505.test index 785b1411596..67ec1045119 100644 --- a/mysql-test/suite/galera/t/galera#505.test +++ b/mysql-test/suite/galera/t/galera#505.test @@ -5,12 +5,9 @@ --connection node_1 SET SESSION wsrep_sync_wait=0; ---disable_result_log ---disable_query_log --let $galera_version=25.3.24 source ../../wsrep/include/check_galera_version.inc; ---enable_result_log ---enable_query_log + SET SESSION wsrep_sync_wait=DEFAULT; # Convert "... pc.weight = N; ..." to "N; ..." diff --git a/mysql-test/suite/galera/t/galera_defaults.cnf b/mysql-test/suite/galera/t/galera_defaults.cnf new file mode 100644 index 00000000000..fb143baf30f --- /dev/null +++ b/mysql-test/suite/galera/t/galera_defaults.cnf @@ -0,0 +1,7 @@ +!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' diff --git a/mysql-test/suite/galera/t/galera_defaults.test b/mysql-test/suite/galera/t/galera_defaults.test index 3f8be268135..28e6f0cce38 100644 --- a/mysql-test/suite/galera/t/galera_defaults.test +++ b/mysql-test/suite/galera/t/galera_defaults.test @@ -1,25 +1,24 @@ # # The purpose of this test is to preserve the current state of the following: # * SHOW VARIABLES LIKE 'wsrep%' -# * wsrep_provider_options # * 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 # developer and QA will be alerted. # --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. ---disable_query_log ---let $galera_version=25.3.20 +--let $galera_version=26.4.6 source ../wsrep/include/check_galera_version.inc; ---enable_query_log # 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 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES diff --git a/mysql-test/suite/wsrep/include/check_galera_version.inc b/mysql-test/suite/wsrep/include/check_galera_version.inc index 32d01197f94..7a58e657f40 100644 --- a/mysql-test/suite/wsrep/include/check_galera_version.inc +++ b/mysql-test/suite/wsrep/include/check_galera_version.inc @@ -21,23 +21,27 @@ SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\3') # Actual 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+).*','\\1') AS UNSIGNED) INTO @ACTUAL_GALERA_RELEASE_VERSION; +--enable_query_log # For testing #SELECT @GALERA_MAJOR_VERSION; #SELECT @GALERA_MINOR_VERSION; #SELECT @GALERA_RELEASE_VERSION; -#SELECT @ACTUAL_GALERA_VERSION; +#SELECT @ACTUAL_GALERA_MAJOR_VERSION; #SELECT @ACTUAL_GALERA_MINOR_VERSION; #SELECT @ACTUAL_GALERA_RELEASE_VERSION; -if (!`SELECT (@ACTUAL_GALERA_MINOR_VERSION > @GALERA_MINOR_VERSION) OR - (@ACTUAL_GALERA_MINOR_VERSION = @GALERA_MINOR_VERSION AND +if (!`SELECT (@ACTUAL_GALERA_MAJOR_VERSION >= @GALERA_MAJOR_VERSION AND @ACTUAL_GALERA_MINOR_VERSION > @GALERA_MINOR_VERSION) OR + (@ACTUAL_GALERA_MAJOR_VERSION = @GALERA_MAJOR_VERSION AND + @ACTUAL_GALERA_MINOR_VERSION = @GALERA_MINOR_VERSION AND @ACTUAL_GALERA_RELEASE_VERSION >= @GALERA_RELEASE_VERSION) `) { skip Test requires Galera library version >= $galera_version; } ---enable_query_log +--echo # Correct Galera library found + -- cgit v1.2.1