2003-06-15 12:01:51 +02:00
|
|
|
# The slave is started with relay_log_space_limit=10 bytes,
|
|
|
|
# to force the deadlock after one event.
|
2003-03-17 22:51:56 +01:00
|
|
|
|
|
|
|
source include/master-slave.inc;
|
|
|
|
connection slave;
|
|
|
|
stop slave;
|
|
|
|
connection master;
|
2003-06-15 12:01:51 +02:00
|
|
|
# This will generate a master's binlog > 10 bytes
|
2003-03-17 22:51:56 +01:00
|
|
|
create table t1 (a int);
|
2003-06-15 12:01:51 +02:00
|
|
|
drop table t1;
|
|
|
|
create table t1 (a int);
|
|
|
|
drop table t1;
|
2003-03-17 22:51:56 +01:00
|
|
|
connection slave;
|
|
|
|
reset slave;
|
2003-06-15 12:01:51 +02:00
|
|
|
start slave io_thread;
|
|
|
|
# Give the I/O thread time to block.
|
|
|
|
sleep 2;
|
|
|
|
# A bug caused the I/O thread to refuse stopping.
|
|
|
|
stop slave io_thread;
|
|
|
|
reset slave;
|
2003-03-17 22:51:56 +01:00
|
|
|
start slave;
|
|
|
|
# The I/O thread stops filling the relay log when
|
2003-06-15 12:01:51 +02:00
|
|
|
# it's >10b. And the SQL thread cannot purge this relay log
|
2003-03-17 22:51:56 +01:00
|
|
|
# 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
|
2003-06-15 12:01:51 +02:00
|
|
|
# it with master_pos_wait that waits for farther than 1Ob;
|
|
|
|
# it will timeout after 10 seconds;
|
2003-03-17 22:51:56 +01:00
|
|
|
# also the slave will probably not cooperate to shutdown
|
|
|
|
# (as 2 threads are locked)
|
2003-06-15 12:01:51 +02:00
|
|
|
select master_pos_wait('master-bin.001',200,6)=-1;
|