mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
b55468d713
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)
114 lines
2.3 KiB
Text
114 lines
2.3 KiB
Text
# This test checks that in a dual-head setup
|
|
# A->B->A, where A has --log-slave-updates (why would it?
|
|
# assume that there is a C as slave of A),
|
|
# then the Exec_master_log_pos of SHOW SLAVE STATUS does
|
|
# not stay too low on B(BUG#13023 due to events ignored because
|
|
# of their server id).
|
|
# It also will test BUG#13861.
|
|
|
|
source include/master-slave.inc;
|
|
|
|
|
|
# set up "dual head"
|
|
|
|
connection slave;
|
|
reset master;
|
|
|
|
connection master;
|
|
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
|
eval change master to master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root";
|
|
|
|
start slave;
|
|
|
|
# now we test it
|
|
|
|
connection slave;
|
|
|
|
create table t1 (n int);
|
|
|
|
save_master_pos;
|
|
connection master;
|
|
sync_with_master;
|
|
|
|
# Now test BUG#13861. This will be enabled when Guilhem fixes this
|
|
# bug.
|
|
|
|
# stop slave
|
|
|
|
# create table t2 (n int); # create one ignored event
|
|
|
|
# save_master_pos;
|
|
# connection slave;
|
|
# sync_with_master;
|
|
|
|
# connection slave;
|
|
|
|
# show tables;
|
|
|
|
# save_master_pos;
|
|
|
|
# create table t3 (n int);
|
|
|
|
# connection master;
|
|
|
|
# bug is that START SLAVE UNTIL may stop too late, we test that by
|
|
# asking it to stop before creation of t3.
|
|
|
|
# start slave until master_log_file="slave-bin.000001",master_log_pos=195;
|
|
|
|
# wait until it's started (the position below is the start of "CREATE
|
|
# TABLE t2") (otherwise wait_for_slave_to_stop may return at once)
|
|
|
|
# select master_pos_wait("slave-bin.000001",137);
|
|
|
|
# --source include/wait_for_slave_to_stop.inc
|
|
|
|
# then BUG#13861 causes t3 to show up below (because stopped too
|
|
# late).
|
|
|
|
# show tables;
|
|
|
|
# start slave;
|
|
|
|
# BUG#13023 is that Exec_master_log_pos may stay too low "forever":
|
|
|
|
connection master;
|
|
|
|
create table t4 (n int); # create 3 ignored events
|
|
create table t5 (n int);
|
|
create table t6 (n int);
|
|
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
|
|
connection slave;
|
|
|
|
save_master_pos;
|
|
|
|
connection master;
|
|
|
|
# then BUG#13023 caused hang below ("master" looks behind, while it's
|
|
# not in terms of updates done).
|
|
|
|
sync_with_master;
|
|
|
|
show tables;
|
|
|
|
# cleanup
|
|
|
|
stop slave;
|
|
reset slave;
|
|
drop table t1,t4,t5,t6; # add t2 and t3 later
|
|
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
|
|
# End of 4.1 tests
|
|
|
|
# Cleanup
|
|
# The A->B->A replication causes the master to start writing relay logs
|
|
# in var/run, remove them
|
|
remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.000001;
|
|
remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.index;
|