| 1 |
############################################################################### |
| 2 |
# Bug#17812024 MTS IS NOT ABLE TO REPRODUCE BINLOGS AS RELAY LOGS |
| 3 |
# Problem: When a binarylog is used as a relaylog (transfer binarylogs to |
| 4 |
# Slave machine to avoid I/O thread reading delay), MTS is unable to operate |
| 5 |
# on that kind of relaylog. |
| 6 |
|
| 7 |
# Steps to Reproduce: |
| 8 |
# 1) Prepare a binary log with some 3 sample GTIDs |
| 9 |
# 2) Make that binary log as relay log |
| 10 |
# 3) Set replica_parallel_workers to 1 and start worker thread |
| 11 |
# 4) Make sure everything is replicated |
| 12 |
############################################################################### |
| 13 |
|
| 14 |
--source include/not_group_replication_plugin.inc |
| 15 |
--source include/have_binlog_format_statement.inc |
| 16 |
--source include/master-slave.inc |
| 17 |
# Initial setup |
| 18 |
--let $MYSQLD_MASTER_DATADIR= `select @@datadir` |
| 19 |
--connection slave |
| 20 |
--let $MYSQLD_SLAVE_DATADIR= `select @@datadir` |
| 21 |
--source include/stop_slave_sql.inc |
| 22 |
|
| 23 |
# Step-1: Prepare a binary log with 3 sample GTIDs |
| 24 |
--connection master |
| 25 |
CREATE TABLE t1(i INT); |
| 26 |
INSERT INTO t1 values (1); |
| 27 |
INSERT INTO t1 values (2); |
| 28 |
--source include/sync_slave_io_with_master.inc |
| 29 |
|
| 30 |
# Step-2: Make that binary log as relay log |
| 31 |
--remove_file $MYSQLD_SLAVE_DATADIR/slave-relay-bin.000001 |
| 32 |
--copy_file $MYSQLD_MASTER_DATADIR/master-bin.000001 $MYSQLD_SLAVE_DATADIR/slave-relay-bin.000001 |
| 33 |
|
| 34 |
# Step-3: Now start worker thread with that relay log(binary log as relay log) |
| 35 |
# and see that worker thread does not have issues in completing it. |
| 36 |
SET @save.replica_parallel_workers=@@global.replica_parallel_workers; |
| 37 |
SET @@global.replica_parallel_workers=1; |
| 38 |
|
| 39 |
SET @save.replica_transaction_retries=@@global.replica_transaction_retries; |
| 40 |
SET @@global.replica_transaction_retries=0; |
| 41 |
--source include/start_slave_sql.inc |
| 42 |
|
| 43 |
# Step-4: Make sure everything is replicated |
| 44 |
--connection master |
| 45 |
--source include/sync_slave_sql_with_master.inc |
| 46 |
--let diff_tables=master:t1,slave:t1 |
| 47 |
--source include/diff_tables.inc |
| 48 |
|
| 49 |
# Cleanup |
| 50 |
--connection master |
| 51 |
DROP TABLE t1; |
| 52 |
--connection slave |
| 53 |
--source include/stop_slave_sql.inc |
| 54 |
--disable_warnings |
| 55 |
SET @@[email protected]_parallel_workers; |
| 56 |
--enable_warnings |
| 57 |
SET @@[email protected]_transaction_retries; |
| 58 |
--source include/start_slave_sql.inc |
| 59 |
--source include/rpl_end.inc |