| 1 |
################################################################################ |
| 2 |
# |
| 3 |
# BUG#22305605 STOP SLAVE IO THREAD PRINTS WRONG LOST CONNECTION MESSAGE |
| 4 |
# IN ERROR LOG FILE. |
| 5 |
|
| 6 |
# Problem: |
| 7 |
# STOP SLAVE IO_THREAD closes socket communication between Master and Slave. |
| 8 |
# This prints an ERROR message in the error log |
| 9 |
# [ERROR] Error reading packet from server: Lost connection to MySQL server |
| 10 |
# during query (server_errno=2013). |
| 11 |
# Here the socket closed intentionally by the DBA using command 'STOP SLAVE IO_THREAD'. |
| 12 |
# Hence no need to print the message [ERROR] that says "Lost connection" which will |
| 13 |
# confusion the users/DBAs. |
| 14 |
|
| 15 |
# Steps to Reproduce: |
| 16 |
# 1) Execute some dummy statements to make sure replication is working fine. |
| 17 |
# 2) Stop I/O thread and see that there is no panic message printed in log file. |
| 18 |
# 3) Stop SQL thread and see that there is no panic message printed in log file. |
| 19 |
# 4) Stop both I/O and SQL threads and see that there is no panic message printed |
| 20 |
# in log file. |
| 21 |
# |
| 22 |
################################################################################ |
| 23 |
|
| 24 |
--source include/master-slave.inc |
| 25 |
|
| 26 |
# Execute dummy statements on Master and sync with Slave. |
| 27 |
CREATE TABLE t1(i INT); |
| 28 |
DROP TABLE t1; |
| 29 |
--source include/sync_slave_sql_with_master.inc |
| 30 |
|
| 31 |
# Case:1 Stop and Start slave IO thread |
| 32 |
--source include/stop_slave_io.inc |
| 33 |
--source include/start_slave_io.inc |
| 34 |
|
| 35 |
# Make sure that there is no "Lost connection" error found in error log file |
| 36 |
--let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/slave_log.err |
| 37 |
--let SEARCH_PATTERN=Lost connection to MySQL server during query |
| 38 |
--source include/search_pattern.inc |
| 39 |
|
| 40 |
# Case:2 Stop and Start slave SQL thread |
| 41 |
--source include/stop_slave_sql.inc |
| 42 |
--source include/start_slave_sql.inc |
| 43 |
|
| 44 |
# Make sure that there is no "Lost connection" error found in error log file |
| 45 |
--let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/slave_log.err |
| 46 |
--let SEARCH_PATTERN=Lost connection to MySQL server during query |
| 47 |
--source include/search_pattern.inc |
| 48 |
|
| 49 |
# Case:3 Stop and start slave IO and SQL thread |
| 50 |
--source include/stop_slave.inc |
| 51 |
--source include/start_slave.inc |
| 52 |
|
| 53 |
# Make sure that there is no "Lost connection" error found in error log file |
| 54 |
--let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/slave_log.err |
| 55 |
--let SEARCH_PATTERN=Lost connection to MySQL server during query |
| 56 |
--source include/search_pattern.inc |
| 57 |
|
| 58 |
--source include/rpl_end.inc |
| 59 |
|
| 60 |
# Initally server was started with --log-error option which creates |
| 61 |
# master_log.err file. check-testcase would fail if we attempt to remove |
| 62 |
# the file. Hence restart is required to clean up the created file. |
| 63 |
# Restart |
| 64 |
--source include/force_restart.inc |