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
2011-01-12 18:35:06 +00:00
|
|
|
-- connection master
|
|
|
|
-- source include/rpl_reset.inc
|
|
|
|
|
2009-09-29 00:04:20 +01:00
|
|
|
-- connection master
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a INT);
|
|
|
|
INSERT INTO t1 VALUES (1);
|
|
|
|
INSERT INTO t1 VALUES (2);
|
|
|
|
INSERT INTO t1 VALUES (3);
|
|
|
|
|
2011-01-13 14:31:37 +00:00
|
|
|
# PART I
|
|
|
|
#
|
|
|
|
# SHOWs contents of binary logs on the master and both, binary and
|
|
|
|
# relay logs, on the slave.
|
|
|
|
#
|
|
|
|
|
2011-01-13 12:21:57 +00:00
|
|
|
--let $is_relay_log= 0
|
|
|
|
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
|
|
|
|
--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
|
2009-09-29 00:04:20 +01:00
|
|
|
|
2011-01-13 12:21:57 +00:00
|
|
|
--sync_slave_with_master
|
|
|
|
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
|
|
|
|
--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
|
2009-09-29 00:04:20 +01:00
|
|
|
|
2011-01-13 12:21:57 +00:00
|
|
|
--let $is_relay_log= 1
|
|
|
|
--let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
|
|
|
|
--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
|
2009-09-29 00:04:20 +01:00
|
|
|
|
2011-01-13 14:31:37 +00:00
|
|
|
#
|
|
|
|
# PART II
|
|
|
|
#
|
|
|
|
# Although this second part of the test may seem redudant it is
|
|
|
|
# actually needed to assert that SHOW RELAYLOG EVENTS works properly
|
|
|
|
# with respect to the ordering of the relay log in relay-log.index.
|
|
|
|
#
|
|
|
|
# If no file is specified with "IN" then first relay log file in
|
|
|
|
# relay-log.index (ie, the oldest one) should be picked and its
|
|
|
|
# contents displayed. The same happens for SHOW BINLOG EVENTS, so we
|
|
|
|
# show them both. All in all, this is the reason for re-assert after
|
|
|
|
# MASTER and SLAVE's FLUSH LOGS operations.
|
|
|
|
#
|
2009-09-29 00:04:20 +01:00
|
|
|
|
2011-01-13 14:31:37 +00:00
|
|
|
FLUSH LOGS;
|
2012-12-17 12:49:11 +01:00
|
|
|
--source include/wait_for_binlog_checkpoint.inc
|
2009-09-29 00:04:20 +01:00
|
|
|
-- connection master
|
|
|
|
FLUSH LOGS;
|
2012-12-17 12:49:11 +01:00
|
|
|
--source include/wait_for_binlog_checkpoint.inc
|
2009-09-29 00:04:20 +01:00
|
|
|
DROP TABLE t1;
|
|
|
|
|
2011-01-13 12:21:57 +00:00
|
|
|
--let $is_relay_log= 0
|
|
|
|
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
|
|
|
|
--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
|
2009-09-29 00:04:20 +01:00
|
|
|
|
2011-01-13 12:21:57 +00:00
|
|
|
--sync_slave_with_master
|
|
|
|
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
|
|
|
|
--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
|
2009-09-29 00:04:20 +01:00
|
|
|
|
2011-01-13 12:21:57 +00:00
|
|
|
--let $is_relay_log= 1
|
|
|
|
--let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
|
|
|
|
--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
|
2009-09-29 00:04:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
# clear show_binlog_event/show_relaylog_events parameters
|
2010-05-26 22:34:25 +08:00
|
|
|
let $binlog_file= ;
|
|
|
|
let $binlog_limit= ;
|