Fix for BUG#11868903 (BUG#59717)

There is a race between two threads: user thread and the dump
thread. The former sets a debug instruction that makes the latter wait
before processing an Xid event. There can be cases that the dump
thread has not yet processed the previous Xid event, causing it to
wait one Xid event too soon, thus causing sync_slave_with_master never
to resume.
      
We fix this by moving the instructions that set the debug variable
after calling sync_slave_with_master.
This commit is contained in:
Luis Soares 2011-03-16 15:11:54 +00:00
parent 6c2f5e306c
commit f39b86d772
2 changed files with 5 additions and 2 deletions

View file

@ -146,6 +146,7 @@ DROP TABLE t1, t2;
CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES(1, 1);
[connection master]
SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
[connection slave]
include/restart_slave.inc

View file

@ -76,11 +76,13 @@ CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES(1, 1);
sync_slave_with_master;
--source include/rpl_connection_master.inc
let $debug_save= `SELECT @@GLOBAL.debug`;
SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
sync_slave_with_master;
--source include/rpl_connection_slave.inc
source include/restart_slave_sql.inc;