| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# This test will issue a CHANGE MASTER TO MASTER_DELAY while both replication |
| 4 |
# threads are stopped and there are content received by the I/O thread yet to |
| 5 |
# be applied by the SQL thread. |
| 6 |
# |
| 7 |
# The test case verifies that issuing the CHANGE MASTER will not purge the |
| 8 |
# relay log, and the replica will not lose master contents. |
| 9 |
# |
| 10 |
# ==== Related Bugs and Worklogs ==== |
| 11 |
# |
| 12 |
# BUG#23203678 CHANGING MASTER_DELAY AFTER STOP SLAVE RESULTS IN LOSS OF EVENTS |
| 13 |
# |
| 14 |
|
| 15 |
# This test case is binary log format agnostic |
| 16 |
--source include/have_binlog_format_mixed.inc |
| 17 |
--source include/master-slave.inc |
| 18 |
|
| 19 |
CREATE TABLE t1 (c1 int); |
| 20 |
--source include/sync_slave_sql_with_master.inc |
| 21 |
--source include/stop_slave_sql.inc |
| 22 |
|
| 23 |
--source include/rpl_connection_master.inc |
| 24 |
INSERT INTO t1 VALUES (1); |
| 25 |
|
| 26 |
--source include/sync_slave_io_with_master.inc |
| 27 |
# As a workaround, not stopping the I/O thread on line below would |
| 28 |
# prevent the slave from purging the relay log. |
| 29 |
--source include/stop_slave_io.inc |
| 30 |
|
| 31 |
CHANGE REPLICATION SOURCE TO SOURCE_DELAY=1; |
| 32 |
--source include/start_slave.inc |
| 33 |
|
| 34 |
--source include/rpl_connection_master.inc |
| 35 |
--source include/sync_slave_sql_with_master.inc |
| 36 |
|
| 37 |
--let $inserted_value=query_get_value(SELECT * FROM t1, c1, 1) |
| 38 |
--let $assert_text= Assert that the \$inserted_value is equal to 1 |
| 39 |
--let $assert_cond= "$inserted_value" = "1" |
| 40 |
--source include/assert.inc |
| 41 |
|
| 42 |
# Clean up |
| 43 |
--source include/stop_slave.inc |
| 44 |
CHANGE REPLICATION SOURCE TO SOURCE_DELAY=0; |
| 45 |
--source include/start_slave.inc |
| 46 |
|
| 47 |
--source include/rpl_connection_master.inc |
| 48 |
DROP TABLE t1; |
| 49 |
--source include/rpl_end.inc |