mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
This patch contains the port of the MDEV-18379 patch for 10.1 branch, but also includes a number of changes made within MDEV-17835, which are necessary for the normal operation of tests that use IPv6: 1) Fixed flaws in the galera_3nodes mtr suite control scripts, because of which they could not work with mariabackup. 2) Fixed numerous bugs in the SST scripts and in the mtr test files (galera_3nodes mtr suite) that prevented the use of Galera with IPv6 addresses. 3) Fixed flaws in tests for rsync and mysqldump (for galera_3nodes mtr tests suite). These tests were not performed successfully without these fixes. 4) Currently, the three-node mtr suite for Galera (galera_3nodes) uses a separate IPv6 availability check using the "have_ipv6.inc" file. This check duplicates a more accurate check at suite.pm level, which can be used by including the file "check_ipv6.inc". This patch removes this discrepancy between suites. 5) GAL-501 test in the galera_3nodes suite does not contain the option "--bind-address=::" which is needed for the test to work correctly with IPv6 (at least on some systems), since without it the server will not wait for connections on the IPv6 interface. https://jira.mariadb.org/browse/MDEV-18379 and partially https://jira.mariadb.org/browse/MDEV-17835
80 lines
3 KiB
Text
80 lines
3 KiB
Text
#
|
|
# This test uses innobackupex to take a backup on node #2 and then restores that node from backup
|
|
#
|
|
|
|
--source include/galera_cluster.inc
|
|
--source include/have_innodb.inc
|
|
--source include/have_mariabackup.inc
|
|
|
|
--let $galera_connection_name = node_3
|
|
--let $galera_server_number = 3
|
|
--source include/galera_connect.inc
|
|
|
|
# Save original auto_increment_offset values.
|
|
--let $node_1=node_1
|
|
--let $node_2=node_2
|
|
--let $node_3=node_3
|
|
--source ../galera/include/auto_increment_offset_save.inc
|
|
|
|
--connection node_1
|
|
CREATE TABLE t1 (f1 INTEGER);
|
|
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
|
|
|
--connection node_2
|
|
SELECT COUNT(*) = 10 FROM t1;
|
|
|
|
--exec rm -rf $MYSQL_TMP_DIR/innobackupex_backup
|
|
--exec mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --galera-info --port=$NODE_MYPORT_2 --host=127.0.0.1 --no-timestamp $MYSQL_TMP_DIR/innobackupex_backup &> $MYSQL_TMP_DIR/innobackupex-backup.log
|
|
--exec mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --apply-log --galera-info --port=$NODE_MYPORT_2 --host=127.0.0.1 --no-timestamp $MYSQL_TMP_DIR/innobackupex_backup &> $MYSQL_TMP_DIR/innobackupex-apply.log
|
|
|
|
--source ../galera/include/kill_galera.inc
|
|
--sleep 1
|
|
|
|
--connection node_1
|
|
INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
|
|
|
|
--exec rm -rf $MYSQLTEST_VARDIR/mysqld.2/data/*
|
|
--exec mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --copy-back --port=$NODE_MYPORT_2 --host=127.0.0.1 $MYSQL_TMP_DIR/innobackupex_backup &> $MYSQL_TMP_DIR/innobackupex-restore.log
|
|
|
|
#
|
|
# Convert the xtrabackup_galera_info into a grastate.dat file
|
|
#
|
|
|
|
--perl
|
|
use strict;
|
|
my $xtrabackup_galera_info_file = $ENV{'MYSQL_TMP_DIR'}.'/innobackupex_backup/xtrabackup_galera_info';
|
|
open(XTRABACKUP_GALERA_INFO, $xtrabackup_galera_info_file) or die "Can not open $xtrabackup_galera_info_file: $!";
|
|
my $xtrabackup_galera_info = <XTRABACKUP_GALERA_INFO>;
|
|
my ($uuid, $seqno) = split(':', $xtrabackup_galera_info);
|
|
|
|
my $grastate_dat_file = $ENV{'MYSQLTEST_VARDIR'}.'/mysqld.2/data/grastate.dat';
|
|
die "grastate.dat already exists" if -e $grastate_dat_file;
|
|
|
|
open(GRASTATE_DAT, ">$grastate_dat_file") or die "Can not write to $grastate_dat_file: $!";
|
|
print GRASTATE_DAT "version: 2.1\n";
|
|
print GRASTATE_DAT "uuid: $uuid\n";
|
|
print GRASTATE_DAT "seqno: $seqno\n";
|
|
print GRASTATE_DAT "cert_index:\n";
|
|
exit(0);
|
|
EOF
|
|
|
|
--source include/start_mysqld.inc
|
|
--sleep 5
|
|
|
|
--source include/wait_until_connected_again.inc
|
|
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
|
--source include/wait_condition.inc
|
|
|
|
SELECT COUNT(*) = 20 FROM t1;
|
|
|
|
DROP TABLE t1;
|
|
|
|
--sleep 10
|
|
|
|
--let $galera_connection_name = node_2a
|
|
--let $galera_server_number = 2
|
|
--source include/galera_connect.inc
|
|
--let $node_2=node_2a
|
|
|
|
# Restore original auto_increment_offset values.
|
|
--source ../galera/include/auto_increment_offset_restore.inc
|