BUG#59147: rpl_circular_for_4_hosts fails sporadically
There is one part of the test case that needs to break and re-establish the circular topology. For this the test stops the slave threads on a couple of servers and restarts them with START SLAVE. However, no check is done on the status of the IO or SQL threads before proceeding with the subsequent commands. Because rpl_only_running_threads is set to 1 this can lead to silently not syncing all slave threads as expected, ultimately resulting in unexpected results (and consequently on a failing test run). We fix this by replacing the START SLAVE instructions with calls to --source include/start_slave.inc, which will wait for the slave threads to be running (show 'Yes' in Slave_IO|SQL_Running fields of SHOW SLAVE STATUS) before proceeding. Additionally, we change rpl_sync.inc to make the IO thread report that it is running when its running status is any other than 'No'.
This commit is contained in:
parent
59269b1da1
commit
cb10771fd8
@ -88,7 +88,7 @@ while ($_rpl_i) {
|
||||
{
|
||||
--echo Sync IO: $_rpl_slave_io_running; Sync SQL: $_rpl_slave_sql_running
|
||||
}
|
||||
--let $_rpl_slave_io_running= `SELECT IF('$_rpl_slave_io_running' = 'Yes', 1, '')`
|
||||
--let $_rpl_slave_io_running= `SELECT IF('$_rpl_slave_io_running' != 'No', 1, '')`
|
||||
--let $_rpl_slave_sql_running= `SELECT IF('$_rpl_slave_sql_running' = 'Yes', 1, '')`
|
||||
if ($_rpl_slave_io_running)
|
||||
{
|
||||
|
@ -121,11 +121,11 @@ Master D 12 D
|
||||
* Remove wrong event from C and restore B->C->D *
|
||||
include/stop_slave.inc
|
||||
DELETE FROM t1 WHERE a = 6;
|
||||
START SLAVE;
|
||||
include/start_slave.inc
|
||||
RESET MASTER;
|
||||
RESET SLAVE;
|
||||
include/rpl_change_topology.inc [new topology=1->2->3->4->1]
|
||||
START SLAVE;
|
||||
include/start_slave.inc
|
||||
include/rpl_sync.inc
|
||||
|
||||
* Check data inserted before restoring schema A->B->C->D->A *
|
||||
|
@ -175,7 +175,7 @@ SELECT 'Master D',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
|
||||
source include/stop_slave.inc;
|
||||
--connection server_3
|
||||
DELETE FROM t1 WHERE a = 6;
|
||||
START SLAVE;
|
||||
--source include/start_slave.inc
|
||||
--connection server_2
|
||||
--sync_slave_with_master server_3
|
||||
RESET MASTER;
|
||||
@ -189,7 +189,7 @@ RESET SLAVE;
|
||||
--source include/rpl_change_topology.inc
|
||||
#--replace_result $SERVER_MYPORT_3 SERVER_MYPORT_3 $file_d LOG_FILE $pos_d LOG_POS
|
||||
#--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SERVER_MYPORT_3,master_user='root',master_log_file='$file_d',master_log_pos=$pos_d
|
||||
START SLAVE;
|
||||
--source include/start_slave.inc
|
||||
--connection server_3
|
||||
--sync_slave_with_master server_4
|
||||
--source include/rpl_sync.inc
|
||||
|
Loading…
x
Reference in New Issue
Block a user