~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
# The slave is started with relay_log_space_limit=10 bytes,
2
# to force the deadlock after one event.
3
4
source include/master-slave.inc;
5
connection slave;
6
stop slave;
7
connection master;
8
# This will generate a master's binlog > 10 bytes
9
create table t1 (a int);
10
drop table t1;
11
create table t1 (a int);
12
drop table t1;
13
connection slave;
14
reset slave;
15
start slave io_thread;
16
# Give the I/O thread time to block.
17
let $slave_param= Slave_IO_State;
18
let $slave_param_value= Waiting for the slave SQL thread to free enough relay log space;
19
source include/wait_for_slave_param.inc;
20
21
# A bug caused the I/O thread to refuse stopping.
22
stop slave io_thread;
23
reset slave;
24
start slave;
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;
36
37
# End of 4.1 tests