| 1 |
source include/not_windows.inc; |
| 2 |
--source include/not_group_replication_plugin.inc |
| 3 |
source include/master-slave.inc; |
| 4 |
CALL mtr.add_suppression("Failed to open log"); |
| 5 |
# |
| 6 |
# BUG#28421 Infinite loop on slave relay logs |
| 7 |
# |
| 8 |
# That, manually deleteing one or more entries from 'master-bin.index', will |
| 9 |
# cause master infinitely loop to send one binlog file. |
| 10 |
# |
| 11 |
# Manually changing index file is a illegal action, so when this happen, we |
| 12 |
# send a fatal error to slave and close the dump session. |
| 13 |
|
| 14 |
FLUSH LOGS; |
| 15 |
# Now, 2 entries in index file. |
| 16 |
# ./master-bin.000001 |
| 17 |
# ./master-bin.000002 |
| 18 |
|
| 19 |
CREATE TABLE t1(c1 INT); |
| 20 |
# Now, the current dump file(master-bin.000002) is the second line of index |
| 21 |
# file |
| 22 |
--source include/sync_slave_sql_with_master.inc |
| 23 |
# Now, all events has been replicate to slave. As current dump file |
| 24 |
# (master-bin.000002) is the last binlog file, so master is waiting for new |
| 25 |
# events. |
| 26 |
|
| 27 |
connection master; |
| 28 |
# Delete './master-bin.000001' from index file. |
| 29 |
let $MYSQLD_DATADIR= `SELECT @@DATADIR`; |
| 30 |
let $file= $MYSQLD_DATADIR/master-bin.index; |
| 31 |
source include/truncate_file.inc; |
| 32 |
|
| 33 |
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`) |
| 34 |
{ |
| 35 |
append_file $MYSQLD_DATADIR/master-bin.index; |
| 36 |
./master-bin.000002 |
| 37 |
EOF |
| 38 |
sleep 0.00000001; |
| 39 |
} |
| 40 |
|
| 41 |
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`) |
| 42 |
{ |
| 43 |
append_file $MYSQLD_DATADIR/master-bin.index; |
| 44 |
.\master-bin.000002 |
| 45 |
EOF |
| 46 |
sleep 0.00000001; |
| 47 |
} |
| 48 |
|
| 49 |
# Now, only 1 entry in index file. ./master-bin.000002 |
| 50 |
|
| 51 |
# Generate master-bin.000003, but it is in the second line. |
| 52 |
FLUSH LOGS; |
| 53 |
# Now, 2 entries in index file. |
| 54 |
# ./master-bin.000002 |
| 55 |
# ./master-bin.000003 |
| 56 |
|
| 57 |
# Now, master know that new binlog file(master-bin.000003) has been generated. |
| 58 |
# It expects that the new binlog file is in third line of index file, but |
| 59 |
# there is no third line in index file. It is so strange that master sends an |
| 60 |
# error to slave. |
| 61 |
call mtr.add_suppression('Got fatal error 1236 from source when reading data from binary log: .*could not find next log'); |
| 62 |
connection slave; |
| 63 |
# 13114 = ER_SERVER_SOURCE_FATAL_ERROR_READING_BINLOG |
| 64 |
--let $slave_io_errno= 13114 |
| 65 |
--let $show_slave_io_error= 1 |
| 66 |
# Mask line numbers |
| 67 |
--let $slave_io_error_replace= / at [0-9]*/ at XXX/ |
| 68 |
--source include/wait_for_slave_io_error.inc |
| 69 |
|
| 70 |
connection master; |
| 71 |
|
| 72 |
source include/truncate_file.inc; |
| 73 |
|
| 74 |
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`) |
| 75 |
{ |
| 76 |
append_file $MYSQLD_DATADIR/master-bin.index; |
| 77 |
./master-bin.000001 |
| 78 |
./master-bin.000002 |
| 79 |
./master-bin.000003 |
| 80 |
EOF |
| 81 |
sleep 0.00000001; |
| 82 |
} |
| 83 |
|
| 84 |
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`) |
| 85 |
{ |
| 86 |
append_file $MYSQLD_DATADIR/master-bin.index; |
| 87 |
.\master-bin.000001 |
| 88 |
.\master-bin.000002 |
| 89 |
.\master-bin.000003 |
| 90 |
EOF |
| 91 |
sleep 0.00000001; |
| 92 |
} |
| 93 |
|
| 94 |
CREATE TABLE t2(c1 INT); |
| 95 |
FLUSH LOGS; |
| 96 |
CREATE TABLE t3(c1 INT); |
| 97 |
FLUSH LOGS; |
| 98 |
CREATE TABLE t4(c1 INT); |
| 99 |
|
| 100 |
connection slave; |
| 101 |
START SLAVE IO_THREAD; |
| 102 |
source include/wait_for_slave_io_to_start.inc; |
| 103 |
|
| 104 |
connection master; |
| 105 |
--source include/sync_slave_sql_with_master.inc |
| 106 |
SHOW TABLES; |
| 107 |
|
| 108 |
connection master; |
| 109 |
DROP TABLE t1, t2, t3, t4; |
| 110 |
--source include/sync_slave_sql_with_master.inc |
| 111 |
|
| 112 |
--echo |
| 113 |
--echo # BUG#21437 server_errno=29 error message flood mysqld error log |
| 114 |
--echo # -------------------------------------------------------------------------- |
| 115 |
--echo # This test verifies if the ER_SOURCE_FATAL_ERROR_READING_BINLOG which |
| 116 |
--echo # insteads of EE_FILENOTFOUND error is sent to slave, so that the slave |
| 117 |
--echo # I/O thread stops immediately. |
| 118 |
|
| 119 |
--source include/rpl_reset.inc |
| 120 |
connection master; |
| 121 |
--echo [ on master ] |
| 122 |
call mtr.add_suppression("Got fatal error 1236 from source when reading data from binary log:"); |
| 123 |
let $MASTER_DATADIR= `SELECT @@DATADIR`; |
| 124 |
CREATE TABLE t1(c1 int); |
| 125 |
DROP TABLE t1; |
| 126 |
|
| 127 |
FLUSH LOGS; |
| 128 |
|
| 129 |
CREATE TABLE t2(c1 int); |
| 130 |
DROP TABLE t2; |
| 131 |
--source include/sync_slave_sql_with_master.inc |
| 132 |
--echo [ on slave ] |
| 133 |
source include/stop_slave.inc; |
| 134 |
|
| 135 |
connection master; |
| 136 |
--echo [ on master ] |
| 137 |
--echo # This operation will result in error EE_FILENOTFOUND which happens |
| 138 |
--echo # when slave IO thread is connecting to master. |
| 139 |
move_file $MASTER_DATADIR/master-bin.000001 $MASTER_DATADIR/master-bin.bak; |
| 140 |
|
| 141 |
connection slave; |
| 142 |
--echo [ on slave ] |
| 143 |
CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_LOG_FILE='master-bin.000001'; |
| 144 |
START SLAVE IO_THREAD; |
| 145 |
--echo # Instead of EE_FILENOTFOUND, ER_SERVER_SOURCE_FATAL_ERROR_READING_BINLOG |
| 146 |
--echo # and the specific information are sent to slave. |
| 147 |
--let $slave_io_errno= 13114 |
| 148 |
--let $show_slave_io_error= 1 |
| 149 |
--source include/wait_for_slave_io_error.inc |
| 150 |
|
| 151 |
connection master; |
| 152 |
--echo [ on master ] |
| 153 |
--echo # Restore master-bin.000001 file |
| 154 |
move_file $MASTER_DATADIR/master-bin.bak $MASTER_DATADIR/master-bin.000001; |
| 155 |
|
| 156 |
connection slave; |
| 157 |
--echo [ on slave ] |
| 158 |
CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_LOG_FILE='master-bin.000002'; |
| 159 |
source include/start_slave.inc; |
| 160 |
|
| 161 |
connection master; |
| 162 |
--echo [ on master ] |
| 163 |
CREATE TABLE t1(c1 INT); |
| 164 |
--source include/sync_slave_sql_with_master.inc |
| 165 |
--echo [ on slave ] |
| 166 |
SELECT * FROM t1; |
| 167 |
|
| 168 |
connection master; |
| 169 |
DROP TABLE t1; |
| 170 |
|
| 171 |
--source include/rpl_end.inc |
| 172 |
|