2
2
# to force the deadlock after one event.
4
4
source include/master-slave.inc;
5
--let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1)
7
--source include/stop_slave.inc
8
9
# This will generate a master's binlog > 10 bytes
9
10
create table t1 (a int);
19
20
source include/wait_for_slave_param.inc;
21
22
# A bug caused the I/O thread to refuse stopping.
23
--source include/stop_slave_io.inc
25
# The I/O thread stops filling the relay log when
26
# it's >10b. And the SQL thread cannot purge this relay log
27
# as purge is done only when the SQL thread switches to another
28
# relay log, which does not exist here.
29
# So we should have a deadlock.
30
# if it is not resolved automatically we'll detect
31
# it with master_pos_wait that waits for farther than 1Ob;
32
# it will timeout after 10 seconds;
33
# also the slave will probably not cooperate to shutdown
34
# (as 2 threads are locked)
35
select master_pos_wait('master-bin.001',200,6)=-1;
25
--source include/start_slave.inc
27
# The I/O thread stops filling the relay log when it's >10b. And the
28
# SQL thread cannot purge this relay log as purge is done only when
29
# the SQL thread switches to another relay log, which does not exist
30
# here. So we should have a deadlock. If it is not resolved
31
# automatically we'll detect it with master_pos_wait that waits for
32
# farther than 1Ob; it will timeout after 300 seconds (which is inline
33
# with the default used for sync_slave_with_master and will protect us
34
# against slow test envs); also the slave will probably not cooperate
35
# to shutdown (as 2 threads are locked)
36
--let $outcome= `SELECT MASTER_POS_WAIT('$master_log_file',200,300) AS mpw;`
38
# master_pos_wait returns:
40
# * >= 0, the number of events the slave had to wait to advance to the
43
# * -1, if there was a timeout
45
# * NULL, if an error occurred, or the SQL thread was not started,
46
# slave master info is not initialized, the arguments are incorrect
47
--let $assert_text= Assert that master_pos_wait does not timeout nor it returns NULL
48
--let $assert_cond= $outcome IS NOT NULL AND $outcome <> -1
49
--source include/assert.inc
52
--source include/rpl_end.inc