mariadb/mysql-test/include/wait_for_slave_to_start.inc

36 lines
860 B
PHP
Raw Normal View History

Updated patch for Bug#28497 based off of Magnus's review mysql-test/include/wait_for_slave_io_to_stop.inc: Updated previous commit to include Magnus's change request from review. In addition, I moved it from the mysql-5.1 to mysql-5.1-maint clone. We now have 3 new replications tools and one tool that has been refactored. 1) include/wait_for_slave_to_stop.inc replaces the old mysqltest.c wait_for_slave_to_stop. NEW: 2) include/wait_for_slave_sql_to_stop.inc is for when you are expecting the slave to get an SQL error and waiting for the SQL Thread to stop. 3) include/wait_for_slave_io_to_stop.inc is used for test that you expect sometype of IO error and the IO Thread to stop. 4) include/wait_for_slave_to_start.inc for waiting for the slave to completely start before moving forward in the test. All 4 tests have a built in loop that will stop the test if any of the tools take too long. mysql-test/include/wait_for_slave_sql_to_stop.inc: Updated previous commit to include Magnus's change request from review. In addition, I moved it from the mysql-5.1 to mysql-5.1-maint clone. We now have 3 new replications tools and one tool that has been refactored. 1) include/wait_for_slave_to_stop.inc replaces the old mysqltest.c wait_for_slave_to_stop. NEW: 2) include/wait_for_slave_sql_to_stop.inc is for when you are expecting the slave to get an SQL error and waiting for the SQL Thread to stop. 3) include/wait_for_slave_io_to_stop.inc is used for test that you expect sometype of IO error and the IO Thread to stop. 4) include/wait_for_slave_to_start.inc for waiting for the slave to completely start before moving forward in the test. All 4 tests have a built in loop that will stop the test if any of the tools take too long. mysql-test/include/wait_for_slave_to_start.inc: Updated previous commit to include Magnus's change request from review. In addition, I moved it from the mysql-5.1 to mysql-5.1-maint clone. We now have 3 new replications tools and one tool that has been refactored. 1) include/wait_for_slave_to_stop.inc replaces the old mysqltest.c wait_for_slave_to_stop. NEW: 2) include/wait_for_slave_sql_to_stop.inc is for when you are expecting the slave to get an SQL error and waiting for the SQL Thread to stop. 3) include/wait_for_slave_io_to_stop.inc is used for test that you expect sometype of IO error and the IO Thread to stop. 4) include/wait_for_slave_to_start.inc for waiting for the slave to completely start before moving forward in the test. All 4 tests have a built in loop that will stop the test if any of the tools take too long. mysql-test/include/wait_for_slave_to_stop.inc: Updated previous commit to include Magnus's change request from review. In addition, I moved it from the mysql-5.1 to mysql-5.1-maint clone. We now have 3 new replications tools and one tool that has been refactored. 1) include/wait_for_slave_to_stop.inc replaces the old mysqltest.c wait_for_slave_to_stop. NEW: 2) include/wait_for_slave_sql_to_stop.inc is for when you are expecting the slave to get an SQL error and waiting for the SQL Thread to stop. 3) include/wait_for_slave_io_to_stop.inc is used for test that you expect sometype of IO error and the IO Thread to stop. 4) include/wait_for_slave_to_start.inc for waiting for the slave to completely start before moving forward in the test. All 4 tests have a built in loop that will stop the test if any of the tools take too long. mysql-test/t/rpl_critical_errors.test: Updated to use new tool(s) mysql-test/t/rpl_dual_pos_advance.test: Updated to use new tool(s) mysql-test/t/rpl_known_bugs_detection.test: Updated to use new tool(s) mysql-test/t/rpl_rotate_logs.test: Updated to use new tool(s) mysql-test/t/rpl_row_inexist_tbl.test: Updated to use new tool(s) mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test: Updated to use new tool(s) mysql-test/extra/rpl_tests/rpl_loaddata.test: Updated to use new tool(s) mysql-test/extra/rpl_tests/rpl_row_tabledefs.test: Updated to use new tool(s) mysql-test/extra/rpl_tests/rpl_stm_000001.test: Updated to use new tool(s) mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test: Updated to use new tool(s)
2007-06-13 05:52:43 +02:00
###################################################
#Author: Jeb
#Date: 2007-06-11
#Purpose: To wait a brief time for slave to start
#Details:
# 1) Fill in and setup variables
# 2) loop through looking for both
# io and sql threads to start
# 3) If loops too long die.
####################################################
connection slave;
let $row_number= 1;
let $run= 1;
let $counter= 300;
while ($run)
{
let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
if (`SELECT '$io_result' = 'Yes'`){
let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
if (`SELECT '$sql_result' = 'Yes'`){
let $run= 0;
}
}
sleep 0.1;
if (!$counter){
--echo "Failed while waiting for slave to start"
SHOW SLAVE STATUS;
exit;
}
dec $counter;
}