3
# The common part of the "rpl_get_master_version_and_clock" test.
4
# Restart slave under network disconnection between slave and master
6
# 1 - Got DBUG_SYNC_POINT lock
7
# 2 - Set DBUG_SYNC_POINT before call mysql_real_query(...) function in get_master_version_and_clock(...) function and hang here
8
# 3 - shutdown master server for simulating network disconnection
9
# 4 - Release DBUG_SYNC_POINT lock
10
# 5 - Check if the slave I/O thread tries to reconnect to master.
12
# Note: Please make sure initialize the $debug_lock when call the test script.
15
if (`SELECT '$debug_lock' = ''`)
17
--die Cannot continue. Please set value for $debug_lock.
23
source include/wait_for_slave_to_stop.inc;
25
source include/wait_for_slave_to_start.inc;
27
# Write file to make mysql-test-run.pl expect the "crash", but don't start
28
# it until it's told to
29
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
33
# Send shutdown to the connected server and give
34
# it 10 seconds to die before zapping it
38
eval SELECT RELEASE_LOCK($debug_lock);
40
# Show slave last IO errno
42
source include/wait_for_slave_io_error.inc;
43
let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1);
44
--echo Check network error happened here
45
if (`SELECT '$last_io_errno' = '2013' || # CR_SERVER_LOST
46
'$last_io_errno' = '2003' || # CR_CONN_HOST_ERROR
47
'$last_io_errno' = '2002' || # CR_CONNECTION_ERROR
48
'$last_io_errno' = '2006' || # CR_SERVER_GONE_ERROR
49
'$last_io_errno' = '1040' || # ER_CON_COUNT_ERROR
50
'$last_io_errno' = '1053' # ER_SERVER_SHUTDOWN
56
# Write file to make mysql-test-run.pl start up the server again
57
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
65
# Call script that will poll the server waiting for it to be back online again
66
--source include/wait_until_connected_again.inc
68
# Turn off reconnect again
72
source include/wait_for_slave_to_start.inc;