| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# This test verifies that when replicate_same_server_id=1 then there should |
| 4 |
# not be any conflicts applying binary log files as relay logs files in a |
| 5 |
# server that has the same server id as the id in the files. |
| 6 |
# |
| 7 |
# ==== Implementation ==== |
| 8 |
# |
| 9 |
# 1) Supress a warning. |
| 10 |
# 2) Initialize source datadir path. |
| 11 |
# 3) Stop the server. |
| 12 |
# 4) Rename the already executed and saved binary logs |
| 13 |
# to relay logs and copy them to the data dir. |
| 14 |
# 5) Restart the server. |
| 15 |
# 6) Start replica. |
| 16 |
# 7) Wait for replica to finish. |
| 17 |
# 8) Cleanup. |
| 18 |
# |
| 19 |
# ==== References ==== |
| 20 |
# |
| 21 |
# Bug#27492990 PARALLEL REPLICATION ALWAYS FAILS WITH SPECIFIC WORKLOAD FROM SYSBENCH |
| 22 |
# |
| 23 |
|
| 24 |
# This test requires row format binlogging. |
| 25 |
--source include/have_binlog_format_row.inc |
| 26 |
--source include/only_mts_replica_parallel_workers.inc |
| 27 |
--source include/only_mts_replica_parallel_type_logical_clock.inc |
| 28 |
|
| 29 |
# 1) Supress a warning. |
| 30 |
call mtr.add_suppression("using --replicate-same-server-id in conjunction with --log-replica-updates would lead to infinite loops in this server."); |
| 31 |
|
| 32 |
# 2) Initialize source data dir path. |
| 33 |
--let $master_datadir= `select @@datadir` |
| 34 |
|
| 35 |
# 3) Stop Server. |
| 36 |
--source include/shutdown_mysqld.inc |
| 37 |
|
| 38 |
# 4) Rename the already executed and saved binary logs to relay logs and copy them to the data dir. |
| 39 |
--copy_file $MYSQL_TEST_DIR/std_data/replicated-bin.000001 $master_datadir/replicate-relay-bin.000001 |
| 40 |
--copy_file $MYSQL_TEST_DIR/std_data/replicated-bin.000002 $master_datadir/replicate-relay-bin.000002 |
| 41 |
--copy_file $MYSQL_TEST_DIR/std_data/replicated-bin.index $master_datadir/replicate-relay-bin.index |
| 42 |
|
| 43 |
# 5) Restart the server. |
| 44 |
--let $restart_parameters="restart: --replicate-same-server-id=1 --server_id=1 --relay-log=replicate-relay-bin" |
| 45 |
--source include/start_mysqld.inc |
| 46 |
|
| 47 |
# 6) Start replica in parallel mode. |
| 48 |
SET GLOBAL RELAY_LOG_PURGE=OFF; |
| 49 |
CHANGE MASTER TO RELAY_LOG_FILE='replicate-relay-bin.000001', RELAY_LOG_POS=1, MASTER_HOST='dummy'; |
| 50 |
START SLAVE SQL_THREAD; |
| 51 |
|
| 52 |
# 7) Wait for replica to finish. |
| 53 |
--let $show_statement= SHOW PROCESSLIST |
| 54 |
--let $field= State |
| 55 |
--let $condition= = 'Replica has read all relay log; waiting for more updates' |
| 56 |
--source include/wait_show_condition.inc |
| 57 |
|
| 58 |
# 8) Cleanup. |
| 59 |
SET GLOBAL RELAY_LOG_PURGE=ON; |
| 60 |
STOP SLAVE SQL_THREAD; |
| 61 |
CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='root'; |