summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/r/rpl_stop_slave.result
diff options
context:
space:
mode:
authorLibing Song <anders.song@greatopensource.com>2011-01-19 01:23:49 +0800
committerLibing Song <anders.song@greatopensource.com>2011-01-19 01:23:49 +0800
commit77bc81b89ca65edb244fe4da30ca61e2f97cb5de (patch)
tree11fe0694d9bc22d3043768149f89f19799639552 /mysql-test/suite/rpl/r/rpl_stop_slave.result
parent5574a2cd91eaf76fd2263b38d64d8c617d3c1d02 (diff)
downloadmariadb-git-77bc81b89ca65edb244fe4da30ca61e2f97cb5de.tar.gz
Bug#58546 test rpl_packet timeout failure sporadically on PB
rpl_packet got a timeout failure sporadically on PB when stopping slave. The real reason of this bug is that STOP SLAVE stopped IO thread first and then stopped SQL thread. It was possible that IO thread stopped after replicating part of a transaction which SQL thread was executing. SQL thread would be hung if the transaction could not be rolled back safely. After this patch, STOP SLAVE will stop SQL thread first and then stop IO thread, which guarantees that IO thread will fetch the reset of the events of the transaction that SQL thread is executing, so that SQL thread can finish the transaction if it cannot be rolled back safely. Added below auxiliary files to make the test code neater. restart_slave_sql.inc rpl_connection_master.inc rpl_connection_slave.inc rpl_connection_slave1.inc
Diffstat (limited to 'mysql-test/suite/rpl/r/rpl_stop_slave.result')
-rw-r--r--mysql-test/suite/rpl/r/rpl_stop_slave.result42
1 files changed, 42 insertions, 0 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result
index 2e9522e8947..ff0061f264b 100644
--- a/mysql-test/suite/rpl/r/rpl_stop_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result
@@ -128,5 +128,47 @@ START SLAVE SQL_THREAD;
include/wait_for_slave_sql_to_start.inc
# Test end
SET GLOBAL debug= '$debug_save';
+include/restart_slave.inc
+[connection master]
+DROP TABLE t1, t2;
+
+# Bug#58546 test rpl_packet timeout failure sporadically on PB
+# ----------------------------------------------------------------------
+# STOP SLAVE stopped IO thread first and then stopped SQL thread. It was
+# possible that IO thread stopped after replicating part of a transaction
+# which SQL thread was executing. SQL thread would be hung if the
+# transaction could not be rolled back safely.
+# It caused some sporadic failures on PB2.
+#
+# This test verifies that when 'STOP SLAVE' is issued by a user, IO
+# thread will continue to fetch the rest events of the transaction which
+# is being executed by SQL thread and is not able to be rolled back safely.
+CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(1, 1);
+SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
+[connection slave]
+include/restart_slave.inc
+BEGIN;
+UPDATE t1 SET c2 = 2 WHERE c1 = 1;
+[connection master]
+BEGIN;
+INSERT INTO t1 VALUES(2, 2);
+INSERT INTO t2 VALUES(1);
+UPDATE t1 SET c2 = 3 WHERE c1 = 1;
+COMMIT;
+[connection slave1]
+STOP SLAVE;
+[connection slave]
+ROLLBACK;
+[connection master]
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'RESET';
+[connection slave]
+include/wait_for_slave_to_stop.inc
+[connection slave1]
+include/start_slave.inc
+[connection master]
DROP TABLE t1, t2;
+SET GLOBAL debug= $debug_save;
include/rpl_end.inc