| 1 |
# `mariadb-dump --dump-slave` multi-source interactions |
| 2 |
# (see `main.rpl_mysqldump_slave` for general testing with single-source) |
| 3 |
|
| 4 |
--source include/have_log_bin.inc |
| 5 |
--let $status_items= Connection_name, Slave_IO_Running, Slave_SQL_Running |
| 6 |
--let $all_slaves_status= 1 |
| 7 |
|
| 8 |
# $MYSQL_DUMP dumps the $SERVER_MYPORT_1 server |
| 9 |
--connect ( active_master, 127.0.0.1, root, , , $SERVER_MYPORT_2) |
| 10 |
--connect (inactive_master, 127.0.0.1, root, , , $SERVER_MYPORT_3) |
| 11 |
--connect ( slave, 127.0.0.1, root, , , $SERVER_MYPORT_1) |
| 12 |
|
| 13 |
evalp CHANGE MASTER TO master_ssl_verify_server_cert=0, |
| 14 |
master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root'; |
| 15 |
START SLAVE SQL_THREAD; |
| 16 |
evalp CHANGE MASTER 'inactive' TO |
| 17 |
master_host='127.0.0.1', master_port=$SERVER_MYPORT_3; |
| 18 |
# wait for the active default '' connection only |
| 19 |
--source include/wait_for_slave_sql_to_start.inc |
| 20 |
|
| 21 |
--echo # Control State |
| 22 |
--source include/show_slave_status.inc |
| 23 |
|
| 24 |
--echo # Basic |
| 25 |
--echo \$MYSQL_DUMP --compact --dump-slave --include-master-host-port test |
| 26 |
--replace_result $SERVER_MYPORT_2 MYPORT_2 $SERVER_MYPORT_3 MYPORT_3 |
| 27 |
--exec $MYSQL_DUMP --compact --dump-slave --include-master-host-port test |
| 28 |
|
| 29 |
# The 'inactive' connection should remain stopped |
| 30 |
# while the active '' connection should restart. |
| 31 |
|
| 32 |
--echo # MDEV-7611 mysqldump --dump-slave always starts stopped slave |
| 33 |
--echo \$MYSQL_DUMP --compact --dump-slave test |
| 34 |
--exec $MYSQL_DUMP --compact --dump-slave test |
| 35 |
--source include/wait_for_slave_sql_to_start.inc |
| 36 |
--source include/show_slave_status.inc |
| 37 |
|
| 38 |
--echo # MDEV-5624 mysqldump --dump-slave option does not restart the replication if the dump has failed |
| 39 |
--echo \$MYSQL_DUMP --compact --dump-slave no_such_db |
| 40 |
--error 2 |
| 41 |
--exec $MYSQL_DUMP --compact --dump-slave no_such_db |
| 42 |
--source include/wait_for_slave_sql_to_start.inc |
| 43 |
--source include/show_slave_status.inc |
| 44 |
|
| 45 |
--echo # Cleanup |
| 46 |
STOP SLAVE SQL_THREAD; |
| 47 |
--disconnect active_master |
| 48 |
--disconnect inactive_master |
| 49 |
--source include/wait_for_slave_sql_to_stop.inc |
| 50 |
--disconnect slave |