| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# Bug#18091217 Slave I/O thread won't attempt auto reconnect to the master / error-code 1159 |
| 4 |
# |
| 5 |
# The slave receiver thread stops due to the 'ER_NET_READ_INTERRUPTED' |
| 6 |
# or 'ER_NET_WRITE_INTERRUPTED' error is encountered while getting |
| 7 |
# timestamp, server id from master, setting @master_heartbeat_period |
| 8 |
# and so on. |
| 9 |
# |
| 10 |
# To fix the problem, we fix to handle the 'ER_NET_READ_INTERRUPTED' |
| 11 |
# and 'ER_NET_WRITE_INTERRUPTED' errors as transient network errors. |
| 12 |
# Then the slave receiver thread attempts to automatically reconnect |
| 13 |
# to the master on these errors. |
| 14 |
# |
| 15 |
# Steps to reproduce: |
| 16 |
# 1) Log on slave, stop slave threads. |
| 17 |
# 2) Active injected error during getting server id from master |
| 18 |
# 3) Start slave theads to verify that their is no error happened. |
| 19 |
# |
| 20 |
|
| 21 |
--source include/master-slave.inc |
| 22 |
# The error injection works only with debug facilities. |
| 23 |
--source include/have_debug.inc |
| 24 |
--source include/have_debug_sync.inc |
| 25 |
# The test is not supposed to have any binlog affairs. |
| 26 |
# Hence it's enough to run only with one binlog format |
| 27 |
--source include/have_binlog_format_mixed.inc |
| 28 |
|
| 29 |
--source include/rpl_connection_slave.inc |
| 30 |
call mtr.add_suppression("Replica I/O .*: Source command COM_REGISTER_REPLICA failed: .*"); |
| 31 |
--source include/stop_slave.inc |
| 32 |
|
| 33 |
--source include/rpl_connection_master.inc |
| 34 |
CREATE TABLE t1 (c1 INT); |
| 35 |
DROP TABLE t1; |
| 36 |
|
| 37 |
--source include/rpl_connection_slave.inc |
| 38 |
--echo # |
| 39 |
--echo # Active injected error during getting server id from master |
| 40 |
--echo # |
| 41 |
|
| 42 |
--let $debug_point= get_source_server_id.ER_NET_READ_INTERRUPTED |
| 43 |
--source include/add_debug_point.inc |
| 44 |
|
| 45 |
START SLAVE; |
| 46 |
# Crash if error happens during getting server id from master |
| 47 |
--let $rpl_allow_error= 0 |
| 48 |
--source include/wait_for_slave_io_to_start.inc |
| 49 |
--source include/rpl_connection_master.inc |
| 50 |
--source include/sync_slave_io_with_master.inc |
| 51 |
|
| 52 |
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err |
| 53 |
--let $assert_count= 0 |
| 54 |
--let $assert_select= fatal error is encountered when it try to get the value of SERVER_ID variable from master |
| 55 |
--let $assert_text= Make sure there is not the error "fatal error is encountered when it try to get the value of SERVER_ID variable from master" in slave's error log. |
| 56 |
--source include/assert_grep.inc |
| 57 |
|
| 58 |
--let $assert_count= 1 |
| 59 |
--let $assert_select= Get source SERVER_ID failed with error |
| 60 |
--let $assert_text= Make sure there is the warning "Get master SERVER_ID failed with error" in slave's error log. |
| 61 |
--source include/assert_grep.inc |
| 62 |
|
| 63 |
--source include/stop_slave.inc |
| 64 |
|
| 65 |
--let $debug_point= get_source_server_id.ER_NET_READ_INTERRUPTED |
| 66 |
--source include/remove_debug_point.inc |
| 67 |
|
| 68 |
# Cleanup |
| 69 |
--source include/start_slave.inc |
| 70 |
--let $assert_file= |
| 71 |
--let $assert_count= |
| 72 |
--let $assert_select= |
| 73 |
--let $assert_text= |
| 74 |
--source include/rpl_end.inc |