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