mirror of
https://github.com/MariaDB/server.git
synced 2025-04-21 22:55:35 +02:00
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:
parent
60035bd2f1
commit
6f50f51e60
6 changed files with 25 additions and 16 deletions
mysql-test/suite
|
@ -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';
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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; ..."
|
||||
|
|
7
mysql-test/suite/galera/t/galera_defaults.cnf
Normal file
7
mysql-test/suite/galera/t/galera_defaults.cnf
Normal 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'
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue