Commit eabc3f75 authored by Mats Kindahl's avatar Mats Kindahl

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.


mysql-test/include/wait_for_slave_sql_to_stop.inc:
  - Increasing default timeout 10 times and allowing it to be configurable.
  - Adding printout of process list on failure.
  - Adding printout of binlog events on master that has not yet been applied,
    unless $keep_connection is true.
parent 58bfe41f
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment