| 1 |
# |
| 2 |
# BUG#45214 |
| 3 |
# The common part of the "rpl_get_master_version_and_clock" test. |
| 4 |
# Restart slave under network disconnection between slave and master |
| 5 |
# following the steps: |
| 6 |
# 0 - Set DEBUG_SYNC_ACTION to wait |
| 7 |
# before call mysql_real_query(...) function in get_master_version_and_clock(...) |
| 8 |
# function and hang here |
| 9 |
# 1 - activate a sync-point through the $dbug_sync_point argument of the test |
| 10 |
# 2 - shutdown master server for simulating network disconnection |
| 11 |
# 3 - signal to the IO thread through $debug_sync_action to unhold from the sync-point |
| 12 |
# 4 - check if the slave I/O thread tries to reconnect to master. |
| 13 |
# |
| 14 |
# Note: make sure to initialize the $debug_sync_action and $dbug_sync_point |
| 15 |
# before calling the test script. |
| 16 |
# |
| 17 |
# Pattern of usage: |
| 18 |
# |
| 19 |
# The caller test supplies the DBUG_EXECUTE_IF name |
| 20 |
# |
| 21 |
# let $dbug_sync_point = 'dbug_execute_if_name'; |
| 22 |
# |
| 23 |
# as well as the action list for DEBUG_SYNC |
| 24 |
# |
| 25 |
# let $debug_sync_action= 'now signal signal_name'; |
| 26 |
# |
| 27 |
# The $dbug_sync_point becomes the value of @@global.debug_dbug generating |
| 28 |
# a newly started IO-slave thread's session value. |
| 29 |
# Notice incremental operations to add and remove dbug_execute_if_name |
| 30 |
# from the global variable allows propagation more dbug arguments |
| 31 |
# out of mtr. |
| 32 |
# The action list is to fire at proper time according to test logics |
| 33 |
# (see pp 0-4 above). |
| 34 |
# |
| 35 |
|
| 36 |
connection slave; |
| 37 |
if (!$debug_sync_action) |
| 38 |
{ |
| 39 |
--die Cannot continue. Please set value for debug_sync_action. |
| 40 |
} |
| 41 |
|
| 42 |
# Restart slave |
| 43 |
--source include/stop_slave.inc |
| 44 |
SET @old_dbug = @@global.debug_dbug; |
| 45 |
eval SET @@global.debug_dbug= "d,$dbug_sync_point"; |
| 46 |
|
| 47 |
--source include/start_slave.inc |
| 48 |
--echo slave is going to hang in get_master_version_and_clock |
| 49 |
|
| 50 |
--let $rpl_server_number= 1 |
| 51 |
--source include/rpl_stop_server.inc |
| 52 |
|
| 53 |
--echo slave is unblocked |
| 54 |
|
| 55 |
eval SET DEBUG_SYNC=$debug_sync_action; |
| 56 |
|
| 57 |
# Show slave last IO errno |
| 58 |
connection slave; |
| 59 |
--echo Check network error happened here |
| 60 |
# '2013' CR_SERVER_LOST |
| 61 |
# '2003' CR_CONN_HOST_ERROR |
| 62 |
# '2002' CR_CONNECTION_ERROR |
| 63 |
# '2006' CR_SERVER_GONE_ERROR |
| 64 |
# '1053' ER_SERVER_SHUTDOWN |
| 65 |
let $slave_io_errno= 1053, 2002, 2003, 2006, 2013; |
| 66 |
--let $slave_io_error_is_nonfatal= 1 |
| 67 |
source include/wait_for_slave_io_error.inc; |
| 68 |
|
| 69 |
# deactivate the sync point of get_master_version_and_clock() |
| 70 |
# now to avoid restarting IO-thread to re-enter it. |
| 71 |
# There will be a new IO thread forked out with its @@session.debug_dbug |
| 72 |
# unset. |
| 73 |
set @@global.debug_dbug= @old_dbug; |
| 74 |
|
| 75 |
--let $rpl_server_number= 1 |
| 76 |
--source include/rpl_start_server.inc |
| 77 |
|
| 78 |
# We don't source include/wait_for_slave_io_to_start.inc, because the |
| 79 |
# IO thread has an error and wait_for_slave_io_to_start.inc fails if |
| 80 |
# the IO thread has an error. |
| 81 |
--let $slave_param= Slave_IO_Running |
| 82 |
--let $slave_param_value= Yes |
| 83 |
--source include/wait_for_slave_param.inc |