| 1 |
source include/have_debug.inc; |
| 2 |
source include/have_debug_sync.inc; |
| 3 |
source include/have_binlog_format_mixed_or_statement.inc; |
| 4 |
source include/master-slave.inc; |
| 5 |
source include/force_myisam_default.inc; |
| 6 |
source include/have_myisam.inc; |
| 7 |
|
| 8 |
--echo |
| 9 |
--echo # Bug#58546 test rpl_packet timeout failure sporadically on PB |
| 10 |
--echo # ---------------------------------------------------------------------- |
| 11 |
--echo # STOP SLAVE stopped IO thread first and then stopped SQL thread. It was |
| 12 |
--echo # possible that IO thread stopped after replicating part of a transaction |
| 13 |
--echo # which SQL thread was executing. SQL thread would be hung if the |
| 14 |
--echo # transaction could not be rolled back safely. |
| 15 |
--echo # It caused some sporadic failures on PB2. |
| 16 |
--echo # |
| 17 |
--echo # This test verifies that when 'STOP SLAVE' is issued by a user, IO |
| 18 |
--echo # thread will continue to fetch the rest events of the transaction which |
| 19 |
--echo # is being executed by SQL thread and is not able to be rolled back safely. |
| 20 |
|
| 21 |
CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; |
| 22 |
CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; |
| 23 |
INSERT INTO t1 VALUES(1, 1); |
| 24 |
|
| 25 |
--source include/sync_slave_sql_with_master.inc |
| 26 |
--source include/stop_slave.inc |
| 27 |
|
| 28 |
--source include/rpl_connection_master.inc |
| 29 |
# make sure there are no zombie threads |
| 30 |
--source include/stop_dump_threads.inc |
| 31 |
|
| 32 |
--let $debug_point= dump_thread_wait_before_send_xid |
| 33 |
--source include/add_debug_point.inc |
| 34 |
|
| 35 |
--source include/rpl_connection_slave.inc |
| 36 |
--source include/start_slave.inc |
| 37 |
|
| 38 |
BEGIN; |
| 39 |
UPDATE t1 SET c2 = 2 WHERE c1 = 1; |
| 40 |
|
| 41 |
--source include/rpl_connection_master.inc |
| 42 |
BEGIN; |
| 43 |
INSERT INTO t1 VALUES(2, 2); |
| 44 |
INSERT INTO t2 VALUES(1); |
| 45 |
UPDATE t1 SET c2 = 3 WHERE c1 = 1; |
| 46 |
COMMIT; |
| 47 |
|
| 48 |
# wait for the dump thread to reach the sync point |
| 49 |
--let $wait_condition= select count(*)=1 from information_schema.processlist where state LIKe '%debug sync point%' and command='Binlog Dump' |
| 50 |
--source include/wait_condition.inc |
| 51 |
|
| 52 |
--source include/rpl_connection_slave1.inc |
| 53 |
let $show_statement= SHOW PROCESSLIST; |
| 54 |
let $field= Info; |
| 55 |
let $condition= = 'UPDATE t1 SET c2 = 3 WHERE c1 = 1'; |
| 56 |
source include/wait_show_condition.inc; |
| 57 |
|
| 58 |
send STOP SLAVE; |
| 59 |
|
| 60 |
--source include/rpl_connection_slave.inc |
| 61 |
ROLLBACK; |
| 62 |
|
| 63 |
--source include/rpl_connection_master.inc |
| 64 |
SET DEBUG_SYNC= 'now SIGNAL signal.continue'; |
| 65 |
# wait for the dump thread to come out of the |
| 66 |
# waiting phase before resetting the signals |
| 67 |
--let $wait_condition= select count(*)=0 from information_schema.processlist where state LIKE '%debug sync point%' and command='Binlog Dump' |
| 68 |
--source include/wait_condition.inc |
| 69 |
SET DEBUG_SYNC= 'RESET'; |
| 70 |
|
| 71 |
--source include/rpl_connection_slave.inc |
| 72 |
source include/wait_for_slave_to_stop.inc; |
| 73 |
|
| 74 |
--source include/rpl_connection_slave1.inc |
| 75 |
reap; |
| 76 |
|
| 77 |
# Slave has stopped, thence lets make sure that |
| 78 |
# we kill the zombie dump threads. Also, make |
| 79 |
# sure that we disable the DBUG_EXECUTE_IF |
| 80 |
# that would set the dump thread to wait |
| 81 |
--source include/rpl_connection_master.inc |
| 82 |
|
| 83 |
--let $debug_point= dump_thread_wait_before_send_xid |
| 84 |
--source include/remove_debug_point.inc |
| 85 |
|
| 86 |
# make sure that there are no zombie threads |
| 87 |
--source include/stop_dump_threads.inc |
| 88 |
|
| 89 |
--source include/rpl_connection_slave1.inc |
| 90 |
# now the dump thread on the master will start |
| 91 |
# from a clena slate, i.e. without the |
| 92 |
# DBUG_EXECUTE_IF set |
| 93 |
source include/start_slave.inc; |
| 94 |
|
| 95 |
--source include/rpl_connection_master.inc |
| 96 |
DROP TABLE t1, t2; |
| 97 |
--source include/rpl_end.inc |
| 98 |
|