| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# This test verifies that executing START SLAVE command after restart of an |
| 4 |
# initialized slave shall return no error. |
| 5 |
# |
| 6 |
# ==== Implementation ==== |
| 7 |
# |
| 8 |
# 1. Initialize the slave by sourcing master-slave.inc without starting the |
| 9 |
# slave threads. |
| 10 |
# |
| 11 |
# 2. Verify that START SLAVE doesn't throw any error when |
| 12 |
# |
| 13 |
# 2.1 Server is shutdown and restarted with --relay-log-recovery=1 so that |
| 14 |
# STOP EVENT is generated in the relay log. |
| 15 |
# |
| 16 |
# 2.2 Server is killed and restarted with --relay-log-recovery=1 and when no |
| 17 |
# STOP EVENTS is generated in the relay log. |
| 18 |
# |
| 19 |
# 3. Verify that a warning saying that "Server was not able to find a rotate |
| 20 |
# event from a master server to initialize relay log recovery" is logged in |
| 21 |
# the error log. |
| 22 |
# |
| 23 |
# ==== References ==== |
| 24 |
# |
| 25 |
# Bug#28996606 REPLICATION DOES NOT START IF RESTART MYSQL AFTER INIT |
| 26 |
# WITHOUT START SLAVE |
| 27 |
|
| 28 |
--source include/have_binlog_format_row.inc |
| 29 |
--source include/have_slave_repository_type_table.inc |
| 30 |
--source include/not_rpl_gtid_only.inc |
| 31 |
|
| 32 |
# 1. Initialize the slave by sourcing master-slave.inc without starting the |
| 33 |
# slave threads. |
| 34 |
--let $rpl_multi_source= 1 |
| 35 |
--let $rpl_topology= 1->2,3->2 |
| 36 |
--let $rpl_skip_start_slave=1 |
| 37 |
--source include/rpl_init.inc |
| 38 |
|
| 39 |
--let $rpl_connection_name= server_2 |
| 40 |
--source include/rpl_connection.inc |
| 41 |
|
| 42 |
CALL mtr.add_suppression("Error during --relay-log-recovery*"); |
| 43 |
CALL mtr.add_suppression("Server was not able to find a rotate event*"); |
| 44 |
CALL mtr.add_suppression("Recovery from source pos*"); |
| 45 |
|
| 46 |
# 2. Verify that START SLAVE doesn't throw any error when |
| 47 |
# |
| 48 |
# 2.1 Server is shutdown and restarted with --relay-log-recovery=1 so that |
| 49 |
# STOP EVENT is generated in the relay log. |
| 50 |
# |
| 51 |
# 2.2 Server is killed and restarted with --relay-log-recovery=1 and when no |
| 52 |
# STOP EVENTS is generated in the relay log. |
| 53 |
|
| 54 |
--let $i=0 |
| 55 |
while ($i < 2) |
| 56 |
{ |
| 57 |
if ($i == 1) |
| 58 |
{ |
| 59 |
# Force kill the slave server and restart it with --relay-log-recovery=1 so |
| 60 |
# that STOP_EVENT is not generated in the relay log. |
| 61 |
--let $rpl_force_stop= 1 |
| 62 |
} |
| 63 |
--let $rpl_server_number= 2 |
| 64 |
--let $rpl_server_parameters= --skip_replica_start=1 |
| 65 |
--source include/rpl_restart_server.inc |
| 66 |
|
| 67 |
--let $rpl_connection_name= server_2 |
| 68 |
--source include/rpl_connection.inc |
| 69 |
|
| 70 |
# START SLAVE should not throw any error. |
| 71 |
--source include/start_slave.inc |
| 72 |
|
| 73 |
# Reset all servers to a clean state without syncing the servers. |
| 74 |
--let $rpl_skip_sync=1 |
| 75 |
--source include/rpl_reset.inc |
| 76 |
--inc $i |
| 77 |
} |
| 78 |
|
| 79 |
# 3. Verify that a warning saying that "Server was not able to find a rotate |
| 80 |
# event from a master server to initialize relay log recovery" is logged in |
| 81 |
# the error log. |
| 82 |
|
| 83 |
--let $assert_file=$MYSQLTEST_VARDIR/log/mysqld.2.err |
| 84 |
# Each test will log two warnings, one fore each channel. |
| 85 |
--let $assert_count= 2 |
| 86 |
--let $assert_select=.* \[Warning\] .* Server was not able to find a rotate event |
| 87 |
--let $assert_text= Found the expected warning line in the error log. |
| 88 |
--source include/assert_grep.inc |
| 89 |
|
| 90 |
--source include/rpl_end.inc |