summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2003-03-17 22:51:56 +0100
committerunknown <guilhem@mysql.com>2003-03-17 22:51:56 +0100
commit40c0b2c6c8b730dec9900c3829b7babf0a5b4772 (patch)
tree5d9a0eaa1fe759e9fccf20738544fe2eab9bbbe8 /mysql-test
parent2103479670e60d1cce4166a4cd67b704bf4743da (diff)
downloadmariadb-git-40c0b2c6c8b730dec9900c3829b7babf0a5b4772.tar.gz
New variable rli->ignore_log_space_limit to resolve
a deadlock between I/O and SQL threads in replication when relay_log_space is too small. This fixes bug #79. sql/log.cc: New variable rli->ignore_log_space_limit to resolve a deadlock between I/O and SQL threads in replication when relay_log_space is too small. sql/slave.cc: New variable rli->ignore_log_space_limit to resolve a deadlock between I/O and SQL threads in replication when relay_log_space is too small. sql/slave.h: New variable rli->ignore_log_space_limit to resolve a deadlock between I/O and SQL threads in replication when relay_log_space is too small. sql/sql_repl.cc: New variable rli->ignore_log_space_limit to resolve a deadlock between I/O and SQL threads in replication when relay_log_space is too small.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/rpl_relayspace.result13
-rw-r--r--mysql-test/t/rpl_relayspace-slave.opt1
-rw-r--r--mysql-test/t/rpl_relayspace.test33
3 files changed, 47 insertions, 0 deletions
diff --git a/mysql-test/r/rpl_relayspace.result b/mysql-test/r/rpl_relayspace.result
new file mode 100644
index 00000000000..5e552ef7400
--- /dev/null
+++ b/mysql-test/r/rpl_relayspace.result
@@ -0,0 +1,13 @@
+slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+slave start;
+stop slave;
+create table t1 (a int);
+reset slave;
+start slave;
+select master_pos_wait('master-bin.001',5000,45)=-1;
+master_pos_wait('master-bin.001',5000,45)=-1
+0
diff --git a/mysql-test/t/rpl_relayspace-slave.opt b/mysql-test/t/rpl_relayspace-slave.opt
new file mode 100644
index 00000000000..9365a2a0a26
--- /dev/null
+++ b/mysql-test/t/rpl_relayspace-slave.opt
@@ -0,0 +1 @@
+ -O relay_log_space_limit=1024 \ No newline at end of file
diff --git a/mysql-test/t/rpl_relayspace.test b/mysql-test/t/rpl_relayspace.test
new file mode 100644
index 00000000000..8d4f01339c7
--- /dev/null
+++ b/mysql-test/t/rpl_relayspace.test
@@ -0,0 +1,33 @@
+# The slave is started with relay_log_space_limit=1024 bytes,
+# to force the deadlock
+
+source include/master-slave.inc;
+connection slave;
+stop slave;
+connection master;
+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;
+connection slave;
+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
+# 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;
+# also the slave will probably not cooperate to shutdown
+# (as 2 threads are locked)
+select master_pos_wait('master-bin.001',5000,45)=-1;