diff options
author | <Dao-Gang.Qu@sun.com> | 2009-07-16 14:56:43 +0800 |
---|---|---|
committer | <Dao-Gang.Qu@sun.com> | 2009-07-16 14:56:43 +0800 |
commit | 8fb14b6df170132db86f9068a873636a12a98aeb (patch) | |
tree | fd56e1a55c360340d0696cfda82bf3f850a028ff /mysql-test/extra | |
parent | 0830a3bef3ec73c10752b4163f06153d5ed5ea63 (diff) | |
download | mariadb-git-8fb14b6df170132db86f9068a873636a12a98aeb.tar.gz |
Bug #45214 get_master_version_and_clock does not report error when queries fail
The "get_master_version_and_clock(...)" function in sql/slave.cc ignores
error and passes directly when queries fail, or queries succeed
but the result retrieved is empty.
The "get_master_version_and_clock(...)" function should try to reconnect master
if queries fail because of transient network problems, and fail otherwise.
The I/O thread should print a warning if the some system variables do not
exist on master (very old master)
Diffstat (limited to 'mysql-test/extra')
-rw-r--r-- | mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test new file mode 100644 index 00000000000..c79ccdd044f --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test @@ -0,0 +1,63 @@ +# +# BUG#45214 +# The common part of the "rpl_get_master_version_and_clock" test. +# Restart slave under network disconnection between slave and master +# following the steps: +# 1 - Got DBUG_SYNC_POINT lock +# 2 - Set DBUG_SYNC_POINT before call mysql_real_query(...) function in get_master_version_and_clock(...) function and hang here +# 3 - shutdown master server for simulating network disconnection +# 4 - Release DBUG_SYNC_POINT lock +# 5 - Check if the slave I/O thread tries to reconnect to master. +# +# Note: Please make sure initialize the $debug_lock when call the test script. +# +connection slave; +if (`SELECT '$debug_lock' = ''`) +{ + --die Cannot continue. Please set value for $debug_lock. +} + +# Restart slave +--disable_warnings +stop slave; +source include/wait_for_slave_to_stop.inc; +start slave; +source include/wait_for_slave_to_start.inc; +connection master; +# Write file to make mysql-test-run.pl expect the "crash", but don't start +# it until it's told to +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait +EOF + +# Send shutdown to the connected server and give +# it 10 seconds to die before zapping it +shutdown_server 10; + +connection slave; +eval SELECT RELEASE_LOCK($debug_lock); + +# Show slave last IO errno +connection slave; +source include/wait_for_slave_io_error.inc; +let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1); +echo Slave_IO_Errno= $last_io_errno; + +# Write file to make mysql-test-run.pl start up the server again +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart +EOF + +connection master; +# Turn on reconnect +--enable_reconnect + +# Call script that will poll the server waiting for it to be back online again +--source include/wait_until_connected_again.inc + +# Turn off reconnect again +--disable_reconnect + +connection slave; +source include/wait_for_slave_to_start.inc; + |