diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-07-25 18:42:06 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-07-25 18:42:06 +0300 |
commit | e9c1701e11e2441435223cc7c00c467f58aaff19 (patch) | |
tree | 6be7d0e8fe87272e1abb2704fdb9859481d8acc2 /mysql-test/suite/galera_3nodes | |
parent | 17794fb9aac9ca4fcb0b1e5904671a025a1b6b74 (diff) | |
parent | f3eb82f048d342c11fc3869eca2e6faed9a4835d (diff) | |
download | mariadb-git-e9c1701e11e2441435223cc7c00c467f58aaff19.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test/suite/galera_3nodes')
4 files changed, 103 insertions, 0 deletions
diff --git a/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result b/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result new file mode 100644 index 00000000000..e3935c32fda --- /dev/null +++ b/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result @@ -0,0 +1,20 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +connection node_3; +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; +COUNT(*) = 10 +1 +Killing server ... +connection node_1; +INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20); +# restart +SELECT COUNT(*) = 20 FROM t1; +COUNT(*) = 20 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup_section.result b/mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup_section.result index 8ec1ff090ff..dc72260d979 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup_section.result +++ b/mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup_section.result @@ -20,5 +20,6 @@ DROP TABLE t1; connection node_1; include/assert_grep.inc [Streaming the backup to joiner at \[::1\]] include/assert_grep.inc [async IST sender starting to serve tcp://\[::1\]:] +connection node_2; include/assert_grep.inc [IST receiver addr using tcp://\[::1\]] include/assert_grep.inc [Prepared IST receiver for 3-6, listening at: tcp://\[::1\]] diff --git a/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test new file mode 100644 index 00000000000..8dfb4660f3e --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test @@ -0,0 +1,80 @@ +# +# 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 diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.test index 7f73e36c0b8..fd76c3586ca 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.test +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.test @@ -53,7 +53,9 @@ DROP TABLE t1; --let $assert_select = async IST sender starting to serve tcp://\[::1\]: --source include/assert_grep.inc +--connection node_2 --let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err +--let $assert_only_after = CURRENT_TEST # There are two ISTs on joiner, the first at the initial startup, the second # during the actual test. |