| 1 |
############################################################################### |
| 2 |
# Bug#21630907: MISSING DATA DETECTED WHEN MAX_BINLOG_SIZE SMALLER ON SLAVE |
| 3 |
# FOR 3 NODE TOPOLOGY |
| 4 |
# |
| 5 |
# Bug#21053163: MIXED BASED REPLICATION LOOSES EVENTS WHEN |
| 6 |
# RELAY_LOG_INFO_REPOSITORY=TABLE |
| 7 |
# |
| 8 |
# Problem: |
| 9 |
# ======= |
| 10 |
# 2 level replication M1 -> S1 ->S2 ( S1 is slave of M1; S2 is slave of S1) |
| 11 |
# replicating a non-transactional storage engine table (e.g. MyISAM) when set |
| 12 |
# relay_log_info_repository=TABLE; and binlog rotation occurs in the middle |
| 13 |
# of statement that was translated to multiple rows, then you loose part of |
| 14 |
# that events. |
| 15 |
# |
| 16 |
# When binlog rotation occurs, on S1 not all rows are written to it's binlog, |
| 17 |
# therefore S2 seamlessly looses part of rows that were translated from one |
| 18 |
# statement to several rows. |
| 19 |
# |
| 20 |
# Test: |
| 21 |
# ===== |
| 22 |
# Have mixed based replication, relay_log_info_repository=TABLE and |
| 23 |
# max_binlog_size=4096 on all servers in 3 NODE TOPOLOGY. On master |
| 24 |
# generate a single WRITE_ROWS_EVENT which has multiple row updates. When |
| 25 |
# this event is replicated to slave, it will be split across relay logs. |
| 26 |
# Test will verify that the data on all servers is the same. |
| 27 |
# In the case of bug if |
| 28 |
# 1) GTID_MODE is set to ON on all three servers, the slave will fail with |
| 29 |
# error code:1837 i.e ER_GTID_NEXT_TYPE_UNDEFINED_GTID. |
| 30 |
# 2) GTID_MODE is set to OFF on all three servers diff tables command will |
| 31 |
# fail. |
| 32 |
############################################################################### |
| 33 |
|
| 34 |
--source include/force_myisam_default.inc |
| 35 |
--source include/have_myisam.inc |
| 36 |
--source include/have_binlog_format_mixed.inc |
| 37 |
--let $rpl_server_count= 3 |
| 38 |
--let $rpl_topology= 1->2->3 |
| 39 |
--disable_warnings |
| 40 |
--source include/rpl_init.inc |
| 41 |
--enable_warnings |
| 42 |
|
| 43 |
--connection server_1 |
| 44 |
--echo Server 1 |
| 45 |
CREATE TABLE `t1` ( |
| 46 |
`id` bigint unsigned NOT NULL auto_increment, |
| 47 |
`val` varchar(255), |
| 48 |
PRIMARY KEY (`id`) |
| 49 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
| 50 |
|
| 51 |
INSERT INTO t1 (val) VALUES (REPEAT('a', 255)); |
| 52 |
INSERT INTO t1 (val) SELECT val FROM t1; |
| 53 |
INSERT INTO t1 (val) SELECT val FROM t1; |
| 54 |
INSERT INTO t1 (val) SELECT val FROM t1; |
| 55 |
INSERT INTO t1 (val) SELECT val FROM t1; |
| 56 |
INSERT INTO t1 (val) SELECT val FROM t1; |
| 57 |
INSERT INTO t1 (val) SELECT val FROM t1; |
| 58 |
|
| 59 |
--echo Syncing all three servers |
| 60 |
--source include/rpl_sync.inc |
| 61 |
--echo Verifying 't1' table contents on all three servers through diff tables. |
| 62 |
--let $diff_tables= server_1:t1, server_2:t1, server_3:t1 |
| 63 |
--source include/diff_tables.inc |
| 64 |
|
| 65 |
# Clean up |
| 66 |
DROP TABLE t1; |
| 67 |
--source include/rpl_sync.inc |
| 68 |
--source include/rpl_end.inc |