From f7c41e2f1dd98b08464de0d953a5b6440efb732c Mon Sep 17 00:00:00 2001 From: Mats Kindahl <mats@mysql.com> Date: Tue, 8 Jul 2008 18:21:02 +0200 Subject: [PATCH] Bug #37939 rpl_row_stop_middle_update fails sporadically on pushbuild Bug #37940 rpl_dual_pos_advance fails sporadically on pushbuild,fail wait_for_slave_to_stop Bug #37941 rpl_flushlog_loop fails sporadically on pushbuild Several tests fail when waiting for the slave to stop in what appears to be timeouts caused by a timeout value set to low. This causes false failures when the servers are loaded. In order to try to avoid false negatives, we increase the timeout 10 times and also print some more information in the event that the slave fails to stop when expected to. We add a printout of the current processes running to be able to see if any process have been executing for an unexpectedly long time, and also print the binlog events at the position indicated by SHOW SLAVE STATUS. --- .../include/wait_for_slave_sql_to_stop.inc | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/mysql-test/include/wait_for_slave_sql_to_stop.inc b/mysql-test/include/wait_for_slave_sql_to_stop.inc index cb5c437a586..7b6eba6cb43 100644 --- a/mysql-test/include/wait_for_slave_sql_to_stop.inc +++ b/mysql-test/include/wait_for_slave_sql_to_stop.inc @@ -8,17 +8,34 @@ # 2) loop through looking for # sql threads to stop # 3) If loops too long die. +# +# INPUT: +# $timeout_counter Number of 1/10 sec to wait +# $keep_connection Do not do any "connect" #################################################### if (!$keep_connection) { + --echo [on slave] connection slave; } let $row_number= 1; let $run= 1; -let $counter= 300; +let $counter = $timeout_counter; +if (!$counter) +{ + let $counter= 3000; +} while ($run) { + if (!$keep_connection) + { + if (!$counter) + { + let $binlog_pos = query_get_value("SHOW SLAVE STATUS", Exec_Master_Log_Pos, 1); + let $binlog_file = query_get_value("SHOW SLAVE STATUS", Master_Log_File, 1); + } + } let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number); if (`SELECT '$sql_result' = 'No'`){ let $run= 0; @@ -26,6 +43,21 @@ while ($run) sleep 0.1; if (!$counter){ --echo "Failed while waiting for slave SQL thread to stop" + if (!$keep_connection) + { + --echo [on master] + connection master; + --echo **** Note that the binlog positions are not read atomically: **** + --echo **** the replication might in reality have progressed further **** + eval SHOW BINLOG EVENTS IN '$binlog_file' FROM $binlog_pos LIMIT 5; + --echo [on slave] + connection slave; + } + --echo **** Note that the process list might have changed since the **** + --echo **** failure was detected **** + SHOW PROCESSLIST; + --echo **** Note that the binlog positions are not read atomically, so **** + --echo **** there is a small risk that the binlog status is incorrect **** query_vertical SHOW SLAVE STATUS; exit; } -- 2.30.9