| 1 |
################################################################################ |
| 2 |
# It tests the cases where the dump thread returns an error to the client. |
| 3 |
################################################################################ |
| 4 |
--source include/not_group_replication_plugin.inc |
| 5 |
--source include/not_rpl_gtid_only.inc |
| 6 |
--source include/have_debug.inc |
| 7 |
--source include/master-slave.inc |
| 8 |
|
| 9 |
call mtr.add_suppression(".* You need to use --log-bin to make .* work."); |
| 10 |
CALL mtr.add_suppression("Failed to open log"); |
| 11 |
--sync_slave_with_master |
| 12 |
--source include/stop_slave.inc |
| 13 |
CHANGE REPLICATION SOURCE TO SOURCE_AUTO_POSITION= 0; |
| 14 |
--source include/start_slave.inc |
| 15 |
--source include/rpl_connection_master.inc |
| 16 |
|
| 17 |
--echo # |
| 18 |
--echo # Error: binlog file doesn't exist |
| 19 |
--echo # |
| 20 |
--error 1 |
| 21 |
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server not-exist.000001 |
| 22 |
|
| 23 |
--echo # |
| 24 |
--echo # Error: master doesn't set server_id |
| 25 |
--echo # |
| 26 |
|
| 27 |
--let $debug_point= simulate_no_server_id |
| 28 |
--source include/add_debug_point.inc |
| 29 |
|
| 30 |
--error 1 |
| 31 |
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server not-exist.000001 |
| 32 |
|
| 33 |
--echo # |
| 34 |
--echo # Error: Error while sending faked rotate event |
| 35 |
--echo # |
| 36 |
|
| 37 |
--let $debug_point= simulate_send_error |
| 38 |
--source include/add_debug_point.inc |
| 39 |
|
| 40 |
--error 1 |
| 41 |
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server master-bin.000001 |
| 42 |
|
| 43 |
--let $debug_point= simulate_no_server_id |
| 44 |
--source include/remove_debug_point.inc |
| 45 |
--let $debug_point= simulate_send_error |
| 46 |
--source include/remove_debug_point.inc |
| 47 |
|
| 48 |
--echo # |
| 49 |
--echo # Error: Fail to open binlog file |
| 50 |
--echo # |
| 51 |
FLUSH BINARY LOGS; |
| 52 |
--let $datadir= `SELECT @@datadir` |
| 53 |
--move_file $datadir/master-bin.000002 $datadir/master-bin-bak.000002 |
| 54 |
|
| 55 |
--error 1 |
| 56 |
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server --stop-never master-bin.000001 |
| 57 |
--move_file $datadir/master-bin-bak.000002 $datadir/master-bin.000002 |
| 58 |
|
| 59 |
--echo # |
| 60 |
--echo # Error: Could not find Format_Description_Event |
| 61 |
--echo # |
| 62 |
--move_file $datadir/master-bin.000001 $datadir/master-bin-bak.000001 |
| 63 |
--copy_file $MYSQLTEST_VARDIR/std_data/binlog_no_fd_event.000001 $datadir/master-bin.000001 |
| 64 |
|
| 65 |
--error 1 |
| 66 |
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server master-bin.000001 |
| 67 |
|
| 68 |
--echo # |
| 69 |
--echo # Error: Fail on reading Previous_gtid_log_event |
| 70 |
--echo # |
| 71 |
--remove_file $datadir/master-bin.000001 |
| 72 |
--copy_file $MYSQLTEST_VARDIR/std_data/binlog_truncated_prev_gtid_event.000001 $datadir/master-bin.000001 |
| 73 |
|
| 74 |
--error 1 |
| 75 |
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-source=BINLOG-DUMP-GTIDS master-bin.000001 |
| 76 |
|
| 77 |
--echo # |
| 78 |
--echo # Error: Fail on reading event |
| 79 |
--echo # |
| 80 |
--remove_file $datadir/master-bin.000001 |
| 81 |
--copy_file $MYSQLTEST_VARDIR/std_data/binlog_truncated_event.000001 $datadir/master-bin.000001 |
| 82 |
|
| 83 |
--error 1 |
| 84 |
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server master-bin.000001 |
| 85 |
|
| 86 |
--move_file $datadir/master-bin-bak.000001 $datadir/master-bin.000001 |
| 87 |
|
| 88 |
--echo # |
| 89 |
--echo # Error: Client requests from a position less than 4 |
| 90 |
--echo # |
| 91 |
--source include/rpl_connection_slave.inc |
| 92 |
--let $slave_io_errno= convert_error(ER_SERVER_SOURCE_FATAL_ERROR_READING_BINLOG) |
| 93 |
--source include/stop_slave.inc |
| 94 |
|
| 95 |
--let $debug_point= request_source_log_pos_3 |
| 96 |
--source include/add_debug_point.inc |
| 97 |
|
| 98 |
START SLAVE IO_THREAD; |
| 99 |
--let $slave_io_errno= 13114 |
| 100 |
call mtr.add_suppression(".* Got fatal error 1236 from source when reading data from binary log"); |
| 101 |
--source include/wait_for_slave_io_error.inc |
| 102 |
|
| 103 |
--let $debug_point= request_source_log_pos_3 |
| 104 |
--source include/remove_debug_point.inc |
| 105 |
|
| 106 |
--echo # |
| 107 |
--echo # Error: Binary log is not open on master |
| 108 |
--echo # |
| 109 |
|
| 110 |
# Need to restart master without binlog |
| 111 |
--let $rpl_server_number= 1 |
| 112 |
--let $rpl_server_parameters= --disable-log-bin --gtid-mode=off |
| 113 |
--source include/rpl_restart_server.inc |
| 114 |
|
| 115 |
--error 1 |
| 116 |
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server master-bin.000001 |
| 117 |
|
| 118 |
--echo # |
| 119 |
--echo # Error: master's gtid_mode is not on |
| 120 |
--echo # |
| 121 |
# Need to restart master without gtid |
| 122 |
--let $rpl_server_parameters= --gtid-mode=off |
| 123 |
--source include/rpl_restart_server.inc |
| 124 |
|
| 125 |
--error 1 |
| 126 |
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-source=BINLOG-DUMP-GTIDS master-bin.000001 |
| 127 |
|
| 128 |
--let $rpl_server_parameters= |
| 129 |
--source include/rpl_restart_server.inc |
| 130 |
|
| 131 |
--echo # |
| 132 |
--echo # Error: Dump thread is killed |
| 133 |
--echo # |
| 134 |
|
| 135 |
--source include/rpl_connection_master.inc |
| 136 |
RESET MASTER; |
| 137 |
CREATE TABLE t1(c1 INT); |
| 138 |
|
| 139 |
--let $debug_point= simulate_kill_dump |
| 140 |
--source include/add_debug_point.inc |
| 141 |
|
| 142 |
# 'stop-never' will cause test timeout if 'kill dump thread' doesn't work well. |
| 143 |
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server master-bin.000001 --stop-never |
| 144 |
|
| 145 |
--echo # |
| 146 |
--echo # Error: Fail to send heartbeat with an net error |
| 147 |
--echo # |
| 148 |
--let $exclude_gtids= `SELECT @@GLOBAL.gtid_executed` |
| 149 |
INSERT INTO t1 VALUES(1); |
| 150 |
|
| 151 |
--let $debug_point= simulate_flush_error |
| 152 |
--source include/add_debug_point.inc |
| 153 |
|
| 154 |
--error 1 |
| 155 |
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-source=BINLOG-DUMP-GTIDS --exclude-gtids=$exclude_gtids master-bin.000001 |
| 156 |
|
| 157 |
--let $debug_point= simulate_kill_dump |
| 158 |
--source include/remove_debug_point.inc |
| 159 |
--let $debug_point= simulate_flush_error |
| 160 |
--source include/remove_debug_point.inc |
| 161 |
|
| 162 |
# Cleanup |
| 163 |
DROP TABLE t1; |
| 164 |
--remove_file $MYSQLTEST_VARDIR/tmp/output |
| 165 |
|
| 166 |
--source include/rpl_connection_slave.inc |
| 167 |
RESET MASTER; |
| 168 |
RESET SLAVE; |
| 169 |
--source include/start_slave.inc |
| 170 |
--source include/rpl_end.inc |