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.
This commit is contained in:
Jan Lindström 2020-11-18 14:21:12 +02:00
parent 60035bd2f1
commit 6f50f51e60
6 changed files with 25 additions and 16 deletions

View file

@ -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';

View file

@ -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

View file

@ -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; ..."

View file

@ -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'

View file

@ -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

View file

@ -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