| 1 |
--source include/have_ndb.inc |
| 2 |
--source include/have_binlog_format_mixed_or_row.inc |
| 3 |
--source suite/ndb_rpl/ndb_master-slave.inc |
| 4 |
|
| 5 |
create table t1 ( |
| 6 |
a int not null, |
| 7 |
b int, |
| 8 |
c int, |
| 9 |
unique(c) |
| 10 |
) engine=NDB; |
| 11 |
|
| 12 |
insert into t1 values(1000, 1000, 1000); |
| 13 |
insert into t1 values(999, 999, 999); |
| 14 |
insert into t1 values(998, 998, 998); |
| 15 |
insert into t1 values(997, 997, 997); |
| 16 |
|
| 17 |
--source include/sync_slave_sql_with_master.inc |
| 18 |
select count(*) from t1; |
| 19 |
|
| 20 |
# Supress warnings from ndbcluster epoch sequence checking |
| 21 |
--disable_query_log ONCE |
| 22 |
call mtr.add_suppression("Replica: SQL thread attempting to apply new epoch.*while lower received epoch.*has not been committed.*"); |
| 23 |
|
| 24 |
--echo # Add rows on replica, used for causing uniqueness violation |
| 25 |
insert into t1 values (2001,2001,1001); |
| 26 |
insert into t1 values (2002,2002,1002); |
| 27 |
insert into t1 values (2003,2003,1003); |
| 28 |
|
| 29 |
--echo # Replica is configured to skip unique key violation error |
| 30 |
SELECT @@GLOBAL.replica_skip_errors; |
| 31 |
|
| 32 |
--echo # Configure the ndbcluster plugin to not verify epoch sequence |
| 33 |
set global ndb_applier_allow_skip_epoch = 1; |
| 34 |
|
| 35 |
--source include/rpl_connection_master.inc |
| 36 |
--echo # Cause a conflict |
| 37 |
insert into t1 values (1002,1002,1002); # Will conflict on c=1002 |
| 38 |
|
| 39 |
--echo # Show the binlog events that will cause error. All the Write_rows events |
| 40 |
--echo # will be batched and not send to NDB until the final Query_log_event |
| 41 |
--echo # containing the COMMIT, that's when the error should be skipped |
| 42 |
--let $binlog_limit= 10, 7 |
| 43 |
--source include/show_binlog_events.inc |
| 44 |
|
| 45 |
--echo # Sync with master, will succeed |
| 46 |
--source include/sync_slave_sql_with_master.inc |
| 47 |
|
| 48 |
--echo # Show that row change was skipped on replica |
| 49 |
select * from t1 where a=1002; |
| 50 |
|
| 51 |
--echo # Show that subsequent changes are replicated |
| 52 |
--source include/rpl_connection_master.inc |
| 53 |
insert into t1 values (3001,3001,3001); |
| 54 |
|
| 55 |
--source include/sync_slave_sql_with_master.inc |
| 56 |
select * from t1 where a=3001; |
| 57 |
|
| 58 |
set global ndb_applier_allow_skip_epoch=0; |
| 59 |
|
| 60 |
--source include/rpl_connection_master.inc |
| 61 |
drop table t1; |
| 62 |
|
| 63 |
# Cleanup Replication |
| 64 |
--source include/rpl_end.inc |