Commit 0ef30fe7 authored by Luis Soares's avatar Luis Soares

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
parent 2fbee31f
-- connection master
-- source include/rpl_reset.inc
-- connection master
CREATE TABLE t1 (a INT);
......@@ -8,18 +11,19 @@ INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
INSERT INTO t1 VALUES (6);
-- echo [MASTER] ********* SOW BINLOG EVENTS IN ... *********
-- echo [MASTER] ********* SHOW BINLOG EVENTS IN ... *********
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS *********
-- echo [MASTER] ********* SHOW BINLOG EVENTS *********
let $binlog_file= ;
-- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows *********
-- echo [MASTER] ********* SHOW BINLOG EVENTS ... LIMIT rows *********
let $binlog_limit= 3;
-- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
-- echo [MASTER] ********* SHOW BINLOG EVENTS ... LIMIT offset,rows *********
let $binlog_limit= 1,4;
-- source include/show_binlog_events.inc
......@@ -28,38 +32,39 @@ let $binlog_limit= ;
-- sync_slave_with_master
-- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... *********
-- echo [SLAVE] ********* SHOW BINLOG EVENTS IN ... *********
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS *********
-- echo [SLAVE] ********* SHOW BINLOG EVENTS *********
let $binlog_file= ;
-- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows *********
-- echo [SLAVE] ********* SHOW BINLOG EVENTS ... LIMIT rows *********
let $binlog_limit= 3;
-- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
-- echo [SLAVE] ********* SHOW BINLOG EVENTS ... LIMIT offset,rows *********
let $binlog_limit= 1,4;
-- source include/show_binlog_events.inc
# clear show_binlog_event/show_relaylog_events parameters
let $binlog_limit= ;
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
-- echo [SLAVE] ********* SHOW RELAYLOG EVENTS IN ... *********
let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
-- source include/show_relaylog_events.inc
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS *********
-- echo [SLAVE] ********* SHOW RELAYLOG EVENTS *********
let $binlog_file= ;
-- source include/show_relaylog_events.inc
-- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows *********
-- echo [MASTER] ********* SHOW RELAYLOG EVENTS ... LIMIT rows *********
let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
let $binlog_limit= 3;
-- source include/show_relaylog_events.inc
-- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows *********
-- echo [MASTER] ********* SHOW RELAYLOG EVENTS ... LIMIT offset,rows *********
let $binlog_limit= 1,3;
-- source include/show_relaylog_events.inc
......@@ -74,28 +79,29 @@ DROP TABLE t1;
let $binlog_file= ;
let $binlog_limit= ;
-- echo [MASTER] ********* SOW BINLOG EVENTS IN ... *********
-- echo [MASTER] ********* SHOW BINLOG EVENTS IN ... *********
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS *********
-- echo [MASTER] ********* SHOW BINLOG EVENTS *********
let $binlog_file= ;
-- source include/show_binlog_events.inc
-- sync_slave_with_master
-- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... *********
-- echo [SLAVE] ********* SHOW BINLOG EVENTS IN ... *********
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS *********
-- echo [SLAVE] ********* SHOW BINLOG EVENTS *********
let $binlog_file= ;
-- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
-- echo [SLAVE] ********* SHOW RELAYLOG EVENTS IN ... *********
let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
-- source include/show_relaylog_events.inc
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS *********
-- echo [SLAVE] ********* SHOW RELAYLOG EVENTS *********
let $binlog_file= ;
-- source include/show_relaylog_events.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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment