mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Simplified a test.
thd->enter_cond() and exit_cond(), so that the I/O thread accepts to stop when it's waiting for relay log space. Reset ignore_log_space_limit to 0 when the SQL thread terminates. mysql-test/r/rpl_relayspace.result: result update mysql-test/t/rpl_relayspace-slave.opt: smaller relay_log_space_limit to speed up things. mysql-test/t/rpl_relayspace.test: Less queries in the test, to make it simpler. Testcase if the IO thread blocked in wait_for_relay_log_space accepts to stop when STOP SLAVE. sql/slave.cc: thd->enter_cond() and exit_cond(), so that the I/O thread accepts to stop when it's waiting on cond (waiting for relay log space). Reset ignore_log_space_limit to 0 when the SQL thread terminates.
This commit is contained in:
@ -6,8 +6,14 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
slave start;
|
||||
stop slave;
|
||||
create table t1 (a int);
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
drop table t1;
|
||||
reset slave;
|
||||
start slave io_thread;
|
||||
stop slave io_thread;
|
||||
reset slave;
|
||||
start slave;
|
||||
select master_pos_wait('master-bin.001',5000,45)=-1;
|
||||
master_pos_wait('master-bin.001',5000,45)=-1
|
||||
select master_pos_wait('master-bin.001',200,6)=-1;
|
||||
master_pos_wait('master-bin.001',200,6)=-1
|
||||
0
|
||||
|
@ -1 +1 @@
|
||||
-O relay_log_space_limit=1024
|
||||
-O relay_log_space_limit=10
|
@ -1,33 +1,32 @@
|
||||
# The slave is started with relay_log_space_limit=1024 bytes,
|
||||
# to force the deadlock
|
||||
# The slave is started with relay_log_space_limit=10 bytes,
|
||||
# to force the deadlock after one event.
|
||||
|
||||
source include/master-slave.inc;
|
||||
connection slave;
|
||||
stop slave;
|
||||
connection master;
|
||||
# This will generate a master's binlog > 10 bytes
|
||||
create table t1 (a int);
|
||||
let $1=200;
|
||||
disable_query_log;
|
||||
while ($1)
|
||||
{
|
||||
# eval means expand $ expressions
|
||||
eval insert into t1 values( $1 );
|
||||
dec $1;
|
||||
}
|
||||
# This will generate one 10kB master's binlog
|
||||
enable_query_log;
|
||||
save_master_pos;
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
drop table t1;
|
||||
connection slave;
|
||||
reset slave;
|
||||
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;
|
||||
start slave;
|
||||
# The I/O thread stops filling the relay log when
|
||||
# it's 1kB. And the SQL thread cannot purge this relay log
|
||||
# it's >10b. And the SQL thread cannot purge this relay log
|
||||
# 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
|
||||
# it with master_pos_wait that waits for farther than 1kB;
|
||||
# it will timeout after 45 seconds;
|
||||
# it with master_pos_wait that waits for farther than 1Ob;
|
||||
# it will timeout after 10 seconds;
|
||||
# also the slave will probably not cooperate to shutdown
|
||||
# (as 2 threads are locked)
|
||||
select master_pos_wait('master-bin.001',5000,45)=-1;
|
||||
select master_pos_wait('master-bin.001',200,6)=-1;
|
||||
|
Reference in New Issue
Block a user