|
| 1 | +--source include/have_binlog_format_mixed.inc |
| 2 | +--source include/master-slave.inc |
| 3 | + |
| 4 | +--let $save_mi_repo_type=`SELECT @@GLOBAL.master_info_repository` |
| 5 | +--let $save_rli_repo_type=`SELECT @@GLOBAL.relay_log_info_repository` |
| 6 | +--let $save_slave_parallel_workers=`SELECT @@global.slave_parallel_workers` |
| 7 | + |
| 8 | +# |
| 9 | +# BUG#20236305: MSR: CRASH ON 'START/STOP SLAVE' CMD I.E. ER1794 -> ER1201 -> CRASH |
| 10 | +# |
| 11 | + |
| 12 | +# Tests that default channel is created even if creation of |
| 13 | +# other channels fails in multisource replication. |
| 14 | +# Test that default channel is always created to preserve |
| 15 | +# backward compatibility. |
| 16 | + |
| 17 | +--source include/rpl_connection_slave.inc |
| 18 | +call mtr.add_suppression("Slave failed to initialize relay log info structure from the repository"); |
| 19 | +call mtr.add_suppression("Slave: Could not start slave for channel"); |
| 20 | +call mtr.add_suppression("Error during --relay-log-recovery: Could not locate rotate event from the master"); |
| 21 | +call mtr.add_suppression("slave with the same server_uuid as this slave has connected to the master"); |
| 22 | +call mtr.add_suppression("Failed to create or recover replication info repositories"); |
| 23 | +--source include/stop_slave.inc |
| 24 | + |
| 25 | +# On the slave |
| 26 | +RESET SLAVE ALL; |
| 27 | +SET GLOBAL master_info_repository='TABLE'; |
| 28 | +SET GLOBAL relay_log_info_repository='TABLE'; |
| 29 | + |
| 30 | +# create a new channel |
| 31 | +--disable_warnings |
| 32 | +--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 33 | +--eval CHANGE MASTER TO MASTER_HOST='localhost', MASTER_USER='root', MASTER_PORT=$MASTER_MYPORT FOR CHANNEL 'ch1' |
| 34 | +--enable_warnings |
| 35 | + |
| 36 | +--echo # |
| 37 | +--echo # RESTART SLAVE SERVER |
| 38 | +--echo # |
| 39 | +--let $rpl_server_number= 2 |
| 40 | +--let $rpl_server_parameters= --relay-log-recovery --skip-slave-start --master-info-repository=TABLE --relay-log-info-repository=TABLE --slave-parallel-workers=4 --relay-log-purge=0 |
| 41 | +--source include/rpl_restart_server.inc |
| 42 | + |
| 43 | +# slave fails to initialize due to BUG#19021091 (default |
| 44 | +# channel cannot recover valid positions from the SQL |
| 45 | +# applier thread). |
| 46 | +--error ER_SLAVE_RLI_INIT_REPOSITORY |
| 47 | +START SLAVE; |
| 48 | + |
| 49 | +# This command would fail with an error, which would |
| 50 | +# fail with error ER_MASTER_INFO . Later when start |
| 51 | +# slave was issued, the server would crash. |
| 52 | +# |
| 53 | +# Now, CHANGE MASTER succeeds (and later START SLAVE |
| 54 | +# fails). |
| 55 | +--disable_warnings |
| 56 | +--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 57 | +--eval CHANGE MASTER TO MASTER_HOST='localhost', MASTER_USER='root', MASTER_PORT=$MASTER_MYPORT FOR CHANNEL 'ch1' |
| 58 | +--enable_warnings |
| 59 | + |
| 60 | +# This would have crashed, but it does not anymore. |
| 61 | +--error ER_SLAVE_RLI_INIT_REPOSITORY |
| 62 | +START SLAVE; |
| 63 | + |
| 64 | +# Lets clear the offending channel and recreate it. |
| 65 | +RESET SLAVE ALL FOR CHANNEL 'ch1'; |
| 66 | +--disable_warnings |
| 67 | +--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 68 | +--eval CHANGE MASTER TO MASTER_HOST='localhost', MASTER_USER='root', MASTER_PORT=$MASTER_MYPORT FOR CHANNEL 'ch1' |
| 69 | +--enable_warnings |
| 70 | + |
| 71 | +# Lets configure the default channel as well. |
| 72 | +--disable_warnings |
| 73 | +--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 74 | +--eval CHANGE MASTER TO MASTER_HOST='localhost', MASTER_USER='root', MASTER_PORT=$MASTER_MYPORT FOR CHANNEL '' |
| 75 | +--enable_warnings |
| 76 | + |
| 77 | +# Lets start the slave (and as such, assert that the |
| 78 | +# START SLAVE command is not failing any more). |
| 79 | +# |
| 80 | +# (There are two channels connected to the same server |
| 81 | +# though, which may render the slave unable to connect, |
| 82 | +# thence not using --source include/start_slave.inc ) |
| 83 | +START SLAVE; |
| 84 | + |
| 85 | +# clean up |
| 86 | +--source include/stop_slave.inc |
| 87 | +RESET SLAVE ALL; |
| 88 | +--replace_result $save_mi_repo_type SAVE_MI_REPO_TYPE |
| 89 | +--eval SET @@global.master_info_repository='$save_mi_repo_type' |
| 90 | +--replace_result $save_rli_repo_type SAVE_RLI_REPO_TYPE |
| 91 | +--eval SET @@global.relay_log_info_repository='$save_rli_repo_type' |
| 92 | +--replace_result $save_slave_parallel_workers SAVE_PARALLEL_WORKERS |
| 93 | +--eval SET @@global.slave_parallel_workers=$save_slave_parallel_workers |
| 94 | + |
| 95 | +--disable_warnings |
| 96 | +--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 97 | +--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$MASTER_MYPORT |
| 98 | +--enable_warnings |
| 99 | +--source include/start_slave.inc |
| 100 | + |
| 101 | +--let $rpl_server_number= 2 |
| 102 | +--let $rpl_server_parameters= |
| 103 | +--source include/rpl_restart_server.inc |
| 104 | +--source include/rpl_connection_master.inc |
| 105 | + |
| 106 | +# |
| 107 | +# BUG#20191813: MSR + MTS: IF WE HAVE ANY INACTIVE CHANNEL, POST RESTART START SLAVE HITS ER1794 |
| 108 | +# |
| 109 | + |
| 110 | +# |
| 111 | +# Added test case of BUG#20191813 for sanity check |
| 112 | +# |
| 113 | +# Test validates that even if the default IO channel |
| 114 | +# is not initialized, the existing channel will be |
| 115 | +# able to start and not throw an error. |
| 116 | +# |
| 117 | + |
| 118 | +--source include/rpl_connection_slave.inc |
| 119 | +call mtr.add_suppression("Slave: Failed to initialize the master info structure for channel"); |
| 120 | +call mtr.add_suppression("The slave coordinator and worker threads are stopped"); |
| 121 | +call mtr.add_suppression("Recovery from master pos"); |
| 122 | +call mtr.add_suppression("It is not possible to change the type of the relay log repository because there are workers repositories with possible"); |
| 123 | +--source include/stop_slave.inc |
| 124 | +RESET SLAVE ALL; |
| 125 | +SET @@global.master_info_repository="TABLE"; |
| 126 | +SET @@global.relay_log_info_repository="TABLE"; |
| 127 | +SET @@global.slave_parallel_workers=5; |
| 128 | +--disable_warnings |
| 129 | +--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 130 | +--eval CHANGE MASTER TO MASTER_HOST='localhost', MASTER_USER='root', MASTER_PORT=$MASTER_MYPORT FOR CHANNEL 'ch_trunk' |
| 131 | +--enable_warnings |
| 132 | +START SLAVE; |
| 133 | + |
| 134 | +--echo === RESTART SLAVE SERVER === |
| 135 | +--let $rpl_server_number= 2 |
| 136 | +--let $rpl_server_parameters= --relay-log-recovery --skip-slave-start --master-info-repository=TABLE --relay-log-info-repository=TABLE --slave-parallel-workers=5 |
| 137 | +--source include/rpl_restart_server.inc |
| 138 | +--source include/rpl_connection_slave.inc |
| 139 | +START SLAVE; |
| 140 | + |
| 141 | +# clean up |
| 142 | +--source include/stop_slave.inc |
| 143 | +RESET SLAVE ALL; |
| 144 | +--replace_result $save_mi_repo_type SAVE_MI_REPO_TYPE |
| 145 | +--eval SET @@global.master_info_repository='$save_mi_repo_type' |
| 146 | +--replace_result $save_rli_repo_type SAVE_RLI_REPO_TYPE |
| 147 | +--eval SET @@global.relay_log_info_repository='$save_rli_repo_type' |
| 148 | +--replace_result $save_slave_parallel_workers SAVE_PARALLEL_WORKERS |
| 149 | +--eval SET @@global.slave_parallel_workers=$save_slave_parallel_workers |
| 150 | + |
| 151 | +--disable_warnings |
| 152 | +--replace_result $MASTER_MYPORT MASTER_MYPORT |
| 153 | +--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$MASTER_MYPORT |
| 154 | +--enable_warnings |
| 155 | +--source include/start_slave.inc |
| 156 | + |
| 157 | +--let $rpl_server_number= 2 |
| 158 | +--let $rpl_server_parameters= |
| 159 | +--source include/rpl_restart_server.inc |
| 160 | +--source include/start_slave.inc |
| 161 | +--source include/rpl_connection_master.inc |
| 162 | + |
| 163 | +--source include/rpl_end.inc |
0 commit comments