| 1 |
--source include/have_binlog_format_mixed.inc |
| 2 |
--source include/master-slave.inc |
| 3 |
# Test requires master-info-repository=TABLE, relay-log-info-repository=TABLE |
| 4 |
--source include/have_slave_repository_type_table.inc |
| 5 |
--source include/only_mts_replica_parallel_workers.inc |
| 6 |
|
| 7 |
--let $save_replica_parallel_workers=`SELECT @@global.replica_parallel_workers` |
| 8 |
|
| 9 |
# |
| 10 |
# BUG#20236305: MSR: CRASH ON 'START/STOP SLAVE' CMD I.E. ER1794 -> ER1201 -> CRASH |
| 11 |
# |
| 12 |
|
| 13 |
# Tests that default channel is created even if creation of |
| 14 |
# other channels fails in multisource replication. |
| 15 |
# Test that default channel is always created to preserve |
| 16 |
# backward compatibility. |
| 17 |
|
| 18 |
--source include/rpl_connection_slave.inc |
| 19 |
CALL mtr.add_suppression("Got fatal error .* from source .* replica with the same server_uuid/server_id"); |
| 20 |
CALL mtr.add_suppression("Error during --relay-log-recovery.*"); |
| 21 |
CALL mtr.add_suppression("Server was not able to find a rotate event from source server.*"); |
| 22 |
--source include/stop_slave.inc |
| 23 |
|
| 24 |
# On the slave |
| 25 |
RESET SLAVE ALL; |
| 26 |
|
| 27 |
# create a new channel |
| 28 |
--disable_warnings |
| 29 |
--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 30 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='localhost', SOURCE_USER='root', SOURCE_PORT=$MASTER_MYPORT FOR CHANNEL 'ch1' |
| 31 |
--enable_warnings |
| 32 |
|
| 33 |
--echo # |
| 34 |
--echo # RESTART SLAVE SERVER |
| 35 |
--echo # |
| 36 |
--let $rpl_server_number= 2 |
| 37 |
--let $rpl_server_parameters= --relay-log-recovery --skip-replica-start --replica-parallel-workers=4 --relay-log-purge=0 |
| 38 |
--source include/rpl_restart_server.inc |
| 39 |
|
| 40 |
# This command earlier failed with error ER_CONNECTION_METADATA and the server would |
| 41 |
# crash when start slave was issued in the later stages. |
| 42 |
# |
| 43 |
--disable_warnings |
| 44 |
--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 45 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='localhost', SOURCE_USER='root', SOURCE_PORT=$MASTER_MYPORT FOR CHANNEL 'ch1' |
| 46 |
--enable_warnings |
| 47 |
|
| 48 |
--source include/start_slave.inc |
| 49 |
|
| 50 |
# Stop the slave to execute RESET SLAVE ALL in next step. |
| 51 |
--source include/stop_slave.inc |
| 52 |
# Lets clear the offending channel and recreate it. |
| 53 |
RESET SLAVE ALL FOR CHANNEL 'ch1'; |
| 54 |
--disable_warnings |
| 55 |
--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 56 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='localhost', SOURCE_USER='root', SOURCE_PORT=$MASTER_MYPORT FOR CHANNEL 'ch1' |
| 57 |
--enable_warnings |
| 58 |
|
| 59 |
# Lets configure the default channel as well. |
| 60 |
--disable_warnings |
| 61 |
--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 62 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='localhost', SOURCE_USER='root', SOURCE_PORT=$MASTER_MYPORT FOR CHANNEL '' |
| 63 |
--enable_warnings |
| 64 |
|
| 65 |
# Lets start the slave (and as such, assert that the |
| 66 |
# START SLAVE command is not failing any more). |
| 67 |
# |
| 68 |
# (There are two channels connected to the same server |
| 69 |
# though, which may render the slave unable to connect, |
| 70 |
# thence not using --source include/start_slave.inc ) |
| 71 |
START SLAVE; |
| 72 |
|
| 73 |
# clean up |
| 74 |
--let $slave_io_errno= convert_error(ER_SERVER_SOURCE_FATAL_ERROR_READING_BINLOG) |
| 75 |
--source include/stop_slave.inc |
| 76 |
RESET SLAVE ALL; |
| 77 |
--replace_result $save_replica_parallel_workers SAVE_PARALLEL_WORKERS |
| 78 |
--eval SET @@global.replica_parallel_workers=$save_replica_parallel_workers |
| 79 |
|
| 80 |
--disable_warnings |
| 81 |
--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 82 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='root', SOURCE_PORT=$MASTER_MYPORT |
| 83 |
--enable_warnings |
| 84 |
--source include/start_slave.inc |
| 85 |
|
| 86 |
--let $rpl_server_number= 2 |
| 87 |
--let $rpl_server_parameters= |
| 88 |
--source include/rpl_restart_server.inc |
| 89 |
--source include/rpl_connection_master.inc |
| 90 |
|
| 91 |
# |
| 92 |
# BUG#20191813: MSR + MTS: IF WE HAVE ANY INACTIVE CHANNEL, POST RESTART START SLAVE HITS ER1794 |
| 93 |
# |
| 94 |
|
| 95 |
# |
| 96 |
# Added test case of BUG#20191813 for sanity check |
| 97 |
# |
| 98 |
# Test validates that even if the default IO channel |
| 99 |
# is not initialized, the existing channel will be |
| 100 |
# able to start and not throw an error. |
| 101 |
# |
| 102 |
|
| 103 |
--source include/rpl_connection_slave.inc |
| 104 |
call mtr.add_suppression("Replica: Failed to initialize the connection metadata structure for channel"); |
| 105 |
call mtr.add_suppression("The replica coordinator and worker threads are stopped"); |
| 106 |
call mtr.add_suppression("Recovery from source pos"); |
| 107 |
call mtr.add_suppression("It is not possible to change the type of the relay log repository because there are workers repositories with possible"); |
| 108 |
--source include/stop_slave.inc |
| 109 |
RESET SLAVE ALL; |
| 110 |
SET @@global.replica_parallel_workers=5; |
| 111 |
--disable_warnings |
| 112 |
--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 113 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='localhost', SOURCE_USER='root', SOURCE_PORT=$MASTER_MYPORT FOR CHANNEL 'ch_trunk' |
| 114 |
--enable_warnings |
| 115 |
|
| 116 |
# make sure that the IO thread related part for the |
| 117 |
# existing channel is indeed started (on slow systems |
| 118 |
# START SLAVE is asynchronous and thus the server |
| 119 |
# could shutdown without having the structures initialized). |
| 120 |
--source include/start_slave.inc |
| 121 |
|
| 122 |
--echo === RESTART SLAVE SERVER === |
| 123 |
--let $rpl_server_number= 2 |
| 124 |
--let $rpl_server_parameters= --relay-log-recovery --skip-replica-start --replica-parallel-workers=5 |
| 125 |
--source include/rpl_restart_server.inc |
| 126 |
--source include/rpl_connection_slave.inc |
| 127 |
START SLAVE; |
| 128 |
|
| 129 |
# clean up |
| 130 |
--source include/stop_slave.inc |
| 131 |
RESET SLAVE ALL; |
| 132 |
--replace_result $save_replica_parallel_workers SAVE_PARALLEL_WORKERS |
| 133 |
--eval SET @@global.replica_parallel_workers=$save_replica_parallel_workers |
| 134 |
|
| 135 |
--disable_warnings |
| 136 |
--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 137 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='root', SOURCE_PORT=$MASTER_MYPORT |
| 138 |
--enable_warnings |
| 139 |
--source include/start_slave.inc |
| 140 |
|
| 141 |
--let $rpl_server_number= 2 |
| 142 |
--let $rpl_server_parameters= |
| 143 |
--source include/rpl_restart_server.inc |
| 144 |
--source include/start_slave.inc |
| 145 |
--source include/rpl_connection_master.inc |
| 146 |
|
| 147 |
--source include/rpl_end.inc |