From f39b86d772fcf805a96068a800bedc6067948b7f Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 16 Mar 2011 15:11:54 +0000 Subject: [PATCH] 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. --- mysql-test/suite/rpl/r/rpl_stop_slave.result | 1 + mysql-test/suite/rpl/t/rpl_stop_slave.test | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result index ff0061f264b..7ea613fedd6 100644 --- a/mysql-test/suite/rpl/r/rpl_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result @@ -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 diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test index e44b2f15f25..8d2b26dd4ea 100644 --- a/mysql-test/suite/rpl/t/rpl_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test @@ -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;