| 1 |
# |
| 2 |
# "mariabackup --slave-info" tests that can be run without |
| 3 |
# actually starting the replication. |
| 4 |
# |
| 5 |
|
| 6 |
--echo # |
| 7 |
--echo # Start of 10.2 tests |
| 8 |
--echo # |
| 9 |
|
| 10 |
--echo # |
| 11 |
--echo # MDEV-21037 mariabackup does not detect multi-source replication slave |
| 12 |
--echo # |
| 13 |
|
| 14 |
--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup |
| 15 |
--let $XTRABACKUP_ARGS=--defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.2 --slave-info --backup --databases=test --target-dir=$targetdir |
| 16 |
--let $XTRABACKUP_OUT=$MYSQLTEST_VARDIR/tmp/xtrabackup_out |
| 17 |
|
| 18 |
# Should be empty by default |
| 19 |
SELECT @@global.gtid_slave_pos; |
| 20 |
|
| 21 |
--echo |
| 22 |
--echo # Without any masters the file mariadb_backup_slave_info is not created |
| 23 |
|
| 24 |
--disable_result_log |
| 25 |
exec $XTRABACKUP $XTRABACKUP_ARGS >$XTRABACKUP_OUT; |
| 26 |
--enable_result_log |
| 27 |
--error 1 |
| 28 |
--file_exists $targetdir/mariadb_backup_slave_info |
| 29 |
--source include/show_xtrabackup_slave_info_out.inc |
| 30 |
--remove_file $XTRABACKUP_OUT |
| 31 |
rmdir $targetdir; |
| 32 |
|
| 33 |
--echo |
| 34 |
CHANGE MASTER TO MASTER_HOST='localhost', MASTER_PORT=10000; |
| 35 |
--disable_result_log |
| 36 |
exec $XTRABACKUP $XTRABACKUP_ARGS >$XTRABACKUP_OUT; |
| 37 |
--enable_result_log |
| 38 |
--source include/show_xtrabackup_slave_info.inc |
| 39 |
--source include/show_xtrabackup_slave_info_out.inc |
| 40 |
--remove_file $XTRABACKUP_OUT |
| 41 |
rmdir $targetdir; |
| 42 |
|
| 43 |
--echo |
| 44 |
CHANGE MASTER 'master2' TO MASTER_HOST='localhost', MASTER_PORT=10002; |
| 45 |
--disable_result_log |
| 46 |
exec $XTRABACKUP $XTRABACKUP_ARGS >$XTRABACKUP_OUT; |
| 47 |
--enable_result_log |
| 48 |
--source include/show_xtrabackup_slave_info.inc |
| 49 |
--source include/show_xtrabackup_slave_info_out.inc |
| 50 |
--remove_file $XTRABACKUP_OUT |
| 51 |
rmdir $targetdir; |
| 52 |
|
| 53 |
--echo |
| 54 |
SET GLOBAL gtid_slave_pos='1-1-1,2-2-2'; |
| 55 |
CHANGE MASTER 'master3' TO MASTER_HOST='localhost', MASTER_PORT=10003, MASTER_USE_GTID=slave_pos; |
| 56 |
CHANGE MASTER 'master4' TO MASTER_HOST='localhost', MASTER_PORT=10004, MASTER_USE_GTID=no; |
| 57 |
CHANGE MASTER 'master5' TO MASTER_HOST='localhost', MASTER_PORT=10005, MASTER_USE_GTID=slave_pos; |
| 58 |
|
| 59 |
--disable_result_log |
| 60 |
exec $XTRABACKUP $XTRABACKUP_ARGS >$XTRABACKUP_OUT; |
| 61 |
--enable_result_log |
| 62 |
--source include/show_xtrabackup_slave_info.inc |
| 63 |
--source include/show_xtrabackup_slave_info_out.inc |
| 64 |
--remove_file $XTRABACKUP_OUT |
| 65 |
rmdir $targetdir; |
| 66 |
|
| 67 |
--echo |
| 68 |
CHANGE MASTER TO MASTER_HOST='localhost', MASTER_PORT=10000, MASTER_USE_GTID=slave_pos; |
| 69 |
--disable_result_log |
| 70 |
exec $XTRABACKUP $XTRABACKUP_ARGS >$XTRABACKUP_OUT; |
| 71 |
--enable_result_log |
| 72 |
--source include/show_xtrabackup_slave_info.inc |
| 73 |
--source include/show_xtrabackup_slave_info_out.inc |
| 74 |
--remove_file $XTRABACKUP_OUT |
| 75 |
rmdir $targetdir; |
| 76 |
|
| 77 |
RESET SLAVE ALL; |
| 78 |
RESET SLAVE 'master2' ALL; |
| 79 |
RESET SLAVE 'master3' ALL; |
| 80 |
RESET SLAVE 'master4' ALL; |
| 81 |
RESET SLAVE 'master5' ALL; |
| 82 |
|
| 83 |
|
| 84 |
--echo # |
| 85 |
--echo # End of 10.2 tests |
| 86 |
--echo # |