rpl_relayspace.test 1.23 KB
Newer Older
unknown's avatar
unknown committed
1 2
# The slave is started with relay_log_space_limit=10 bytes,
# to force the deadlock after one event.
3 4 5 6

source include/master-slave.inc;
connection slave;
stop slave;
Serge Kozlov's avatar
Serge Kozlov committed
7
--source include/wait_for_slave_to_stop.inc
8
connection master;
unknown's avatar
unknown committed
9
# This will generate a master's binlog > 10 bytes
10
create table t1 (a int);
unknown's avatar
unknown committed
11 12 13
drop table t1;
create table t1 (a int);
drop table t1;
14 15
connection slave;
reset slave;
unknown's avatar
unknown committed
16 17
start slave io_thread;
# Give the I/O thread time to block.
unknown's avatar
unknown committed
18 19 20 21
let $slave_param= Slave_IO_State;
let $slave_param_value= Waiting for the slave SQL thread to free enough relay log space;
source include/wait_for_slave_param.inc;

unknown's avatar
unknown committed
22 23 24
# A bug caused the I/O thread to refuse stopping.
stop slave io_thread;
reset slave;
25 26
start slave;
# The I/O thread stops filling the relay log when
unknown's avatar
unknown committed
27
# it's >10b. And the SQL thread cannot purge this relay log
28 29 30 31
# as purge is done only when the SQL thread switches to another
# relay log, which does not exist here.
# So we should have a deadlock.
# if it is not resolved automatically we'll detect
unknown's avatar
unknown committed
32 33
# it with master_pos_wait that waits for farther than 1Ob;
# it will timeout after 10 seconds;
34 35
# also the slave will probably not cooperate to shutdown
# (as 2 threads are locked)
unknown's avatar
unknown committed
36
select master_pos_wait('master-bin.001',200,6)=-1;
37 38

# End of 4.1 tests