| 1 |
--echo ######################################################################### |
| 2 |
--echo # Verify: |
| 3 |
--echo # Relay log file names are properly set for multisource replication |
| 4 |
--echo # In this tests we test if relay log files per channel based |
| 5 |
--echo # on --relay-log-index and --relay-log is properly set. |
| 6 |
--echo # 1. The slave is started with --relay-log=msr-relay |
| 7 |
--echo # 2. the slave is restarted with --relay-log-index=idx-msr-relay |
| 8 |
--echo # 3. the slave is restarted with --relay-log-index=idx-msr-relay.idx |
| 9 |
--echo # and --relay-log=msr-relay.log |
| 10 |
--echo ######################################################################### |
| 11 |
|
| 12 |
#Skip on group replication runs |
| 13 |
--source include/not_group_replication_plugin.inc |
| 14 |
--source include/have_binlog_format_row.inc |
| 15 |
# Test requires master-info-repository=TABLE, relay-log-info-repository=TABLE |
| 16 |
--source include/have_slave_repository_type_table.inc |
| 17 |
--source include/master-slave.inc |
| 18 |
|
| 19 |
--source include/rpl_connection_slave.inc |
| 20 |
--let $datadir= `SELECT @@GLOBAL.datadir` |
| 21 |
|
| 22 |
# add new channel |
| 23 |
CHANGE REPLICATION SOURCE TO SOURCE_HOST="localhost", SOURCE_PORT=10 FOR CHANNEL "channel1"; |
| 24 |
|
| 25 |
--echo # |
| 26 |
--echo # Check that the names of relay log files per channel are properly set |
| 27 |
--echo # |
| 28 |
#verify the index file and relay log file name of ch1 is properly set with |
| 29 |
#channel name appended |
| 30 |
FLUSH RELAY LOGS; |
| 31 |
FLUSH RELAY LOGS FOR CHANNEL "channel1"; |
| 32 |
|
| 33 |
--let $relay_log_file_channel1=`SELECT CONCAT('$datadir','msr-relay-channel1.000001')` |
| 34 |
--file_exists $relay_log_file_channel1 |
| 35 |
|
| 36 |
--let $relay_log_index_channel1= `SELECT CONCAT('$datadir', 'msr-relay-channel1.index')` |
| 37 |
--file_exists $relay_log_index_channel1 |
| 38 |
|
| 39 |
--echo # |
| 40 |
--echo # RESET SLAVE ALL for next test; |
| 41 |
--echo # |
| 42 |
--source include/rpl_stop_slaves.inc |
| 43 |
RESET SLAVE ALL; |
| 44 |
|
| 45 |
--echo # |
| 46 |
--echo # 2. Shutdown server. Remove relay log files. Start server with |
| 47 |
--echo # --relay-log-index |
| 48 |
--echo # |
| 49 |
--let $rpl_server_number= 2 |
| 50 |
--source include/rpl_stop_server.inc |
| 51 |
|
| 52 |
--remove_files_wildcard $datadir *msr-relay* |
| 53 |
|
| 54 |
--let $rpl_server_number= 2 |
| 55 |
--let $rpl_server_parameters=--relay-log-index=idx-msr-relay |
| 56 |
--source include/rpl_start_server.inc |
| 57 |
|
| 58 |
# add new channel |
| 59 |
CHANGE REPLICATION SOURCE TO SOURCE_HOST="localhost", SOURCE_PORT=10 FOR CHANNEL "channel1"; |
| 60 |
|
| 61 |
--echo # |
| 62 |
--echo # Check that the names of relay log files per channel are properly set |
| 63 |
--echo # |
| 64 |
#verify the index file and relay log file name of ch1 and default is properly set with |
| 65 |
FLUSH RELAY LOGS; |
| 66 |
FLUSH RELAY LOGS FOR CHANNEL "channel1"; |
| 67 |
|
| 68 |
--let $relay_log_file_channel1=`SELECT CONCAT('$datadir','msr-relay-channel1.000001')` |
| 69 |
--file_exists $relay_log_file_channel1 |
| 70 |
|
| 71 |
--let $relay_log_index_channel1= `SELECT CONCAT('$datadir', 'idx-msr-relay-channel1.index')` |
| 72 |
--file_exists $relay_log_index_channel1 |
| 73 |
|
| 74 |
--echo # |
| 75 |
--echo # RESET SLAVE ALL cleaningup. |
| 76 |
--echo # |
| 77 |
--source include/rpl_stop_slaves.inc |
| 78 |
RESET SLAVE ALL; |
| 79 |
|
| 80 |
--echo # |
| 81 |
--echo # 3. Shutdown server. Remove relay log files. Start server with |
| 82 |
--echo # --relay-log-index and --relay-log with extensions. |
| 83 |
--echo # These extensions shall be stripped off |
| 84 |
--let $rpl_server_number= 2 |
| 85 |
--source include/rpl_stop_server.inc |
| 86 |
|
| 87 |
--remove_files_wildcard $datadir *msr-relay* |
| 88 |
|
| 89 |
--let $rpl_server_number= 2 |
| 90 |
--let $rpl_server_parameters=--relay-log-index=idx-msr-relay.index1 --relay-log=msr-relay.log1 |
| 91 |
--source include/rpl_start_server.inc |
| 92 |
|
| 93 |
# add new channel |
| 94 |
CHANGE REPLICATION SOURCE TO SOURCE_HOST="localhost", SOURCE_PORT=10 FOR CHANNEL "channel1"; |
| 95 |
|
| 96 |
--echo # |
| 97 |
--echo # Check that the names of relay log files per channel are properly set |
| 98 |
--echo # |
| 99 |
#verify the index file and relay log file name of ch1 and default is properly set with |
| 100 |
FLUSH RELAY LOGS; |
| 101 |
FLUSH RELAY LOGS FOR CHANNEL "channel1"; |
| 102 |
|
| 103 |
--let $relay_log_file_channel1=`SELECT CONCAT('$datadir','msr-relay-channel1.000001')` |
| 104 |
--file_exists $relay_log_file_channel1 |
| 105 |
|
| 106 |
--let $relay_log_index_channel1= `SELECT CONCAT('$datadir', 'idx-msr-relay-channel1.index')` |
| 107 |
--file_exists $relay_log_index_channel1 |
| 108 |
|
| 109 |
--echo # |
| 110 |
--echo # RESET SLAVE ALL cleaningup. |
| 111 |
--echo # |
| 112 |
--source include/rpl_stop_slaves.inc |
| 113 |
RESET SLAVE ALL; |
| 114 |
|
| 115 |
--echo # |
| 116 |
--echo # We have to reset the --relay-log and --relay-log-index options, |
| 117 |
--echo # so that in the next test case if the server restarts there is no mismatch |
| 118 |
--echo # with the current options and the default option (i.e relay-log=slave-relay-bin) |
| 119 |
--echo # |
| 120 |
--source include/force_restart.inc |
| 121 |
|
| 122 |
--disable_warnings |
| 123 |
--replace_result $MASTER_MYPORT MYPORT |
| 124 |
eval CHANGE REPLICATION SOURCE TO SOURCE_HOST="127.0.0.1", SOURCE_PORT=$MASTER_MYPORT, |
| 125 |
SOURCE_USER="root"; |
| 126 |
--enable_warnings |
| 127 |
|
| 128 |
--source include/start_slave.inc |
| 129 |
--source include/rpl_end.inc |
| 130 |
|