summaryrefslogtreecommitdiff
path: root/mysql-test/include/setup_fake_relay_log.inc
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@oracle.com>2011-01-12 18:35:06 +0000
committerLuis Soares <luis.soares@oracle.com>2011-01-12 18:35:06 +0000
commit0ef30fe73218842abea32153879a54e1bc8c0877 (patch)
treec18a687ce55603c306b0c75f51faa427e67e55f9 /mysql-test/include/setup_fake_relay_log.inc
parent2fbee31f12c1788de03495c1e35544ec4383df8a (diff)
downloadmariadb-git-0ef30fe73218842abea32153879a54e1bc8c0877.tar.gz
BUG#59444: rpl_row_show_relaylog_events fails on daily-5.5 test runs
The test started failing on the same day patch for BUG 49978 was pushed. BUG 49978 changed part of the replication testing infrastructure in mysql-test-run. This caused the test to fail sporadically with result differences on relay log file names. When the test fails the relay-log filenames are shifted by one, eg: -show relaylog events in 'slave-relay-bin.000002' from <binlog_start>; +show relaylog events in 'slave-relay-bin.000003' from <binlog_start>; The problem was caused by a bad cleanup when using the include files: - include/setup_fake_relay_log.inc - include/cleanup_fake_relay_log.inc Which would leave a spurious relay-log file around (not listed in slave-relay-bin.index), causing the server to shift the name of the relay logs by one, even if cleaning up with RESET SLAVE. We fix this by removing the relay-log file when it is not needed anymore, ie at setup time and after recreating the fake relay-log index. Additionally, to make the affected test more resilient, we deployed a call to rpl_reset.inc (which resets both master and slave, including log files) before actually running the test case. Finally, appart from the reported bug, we also fix: (a) an unrelated issue with the failing test itself - in some cases, the test was not setting the log file name to use when it should; (b) one typo. mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc: Added call to rpl_reset.inc. Deployed missing instructions to get the binlog file name before including show_relaylog/binlog_events.inc
Diffstat (limited to 'mysql-test/include/setup_fake_relay_log.inc')
-rw-r--r--mysql-test/include/setup_fake_relay_log.inc3
1 files changed, 3 insertions, 0 deletions
diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc
index da3ce8e6038..4f1d4f6f162 100644
--- a/mysql-test/include/setup_fake_relay_log.inc
+++ b/mysql-test/include/setup_fake_relay_log.inc
@@ -74,6 +74,7 @@ let $_fake_relay_index= $_fake_datadir/$_fake_filename.index;
let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`;
RESET SLAVE;
+let $_orphan_relay_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
# Create relay log file.
--copy_file $fake_relay_log $_fake_relay_log
@@ -102,6 +103,8 @@ RESET SLAVE;
# Setup replication from existing relay log.
eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_filename-fake.000001', RELAY_LOG_POS=4;
+# remove the orphan log file (became spurious)
+-- remove_file $_fake_datadir/$_orphan_relay_file
--let $include_filename= setup_fake_relay_log.inc
--source include/end_include_file.inc