1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
#
# 1) Create a master-slave setup.
#
include/master-slave.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
[connection master]
#
# 2) Create a table on master, sync it, stop the slave threads and dump
# thread on master.
#
CREATE TABLE t1 (a INT) ENGINE = InnoDB;
include/sync_slave_sql_with_master.inc
include/stop_slave.inc
[connection master]
include/stop_dump_threads.inc
#
# 3) On master, generate a transaction, flush the binary log and execute
# PURGE BINARY LOGS TO command so that only remaining binlog only contains
# transaction UUID:3.
#
INSERT INTO t1 VALUES (1);
FLUSH LOGS;
INSERT INTO t1 VALUES (2);
PURGE BINARY LOGS TO 'master-bin.000002';
include/assert.inc [PURGE BINARY LOGS successfully removed all but the latest file]
#
# 4) Verify that the slave fails if it tries to connect using CHANGE
# MASTER TO MASTER_AUTO_POSITION=1.
#
[connection slave]
CHANGE REPLICATION SOURCE TO SOURCE_AUTO_POSITION = 1;
START SLAVE;
Warnings:
Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/wait_for_slave_io_error.inc [errno=13114 # ER_SOURCE_FATAL_ERROR_READING_BINLOG]
include/stop_slave_sql.inc
[connection master]
SET @saved_debug= @@GLOBAL.DEBUG;
SET GLOBAL DEBUG= '+d,simulate_long_missing_gtids';
[connection slave]
START SLAVE;
Warnings:
Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/wait_for_slave_io_error.inc [errno=13114 # ER_SOURCE_FATAL_ERROR_READING_BINLOG]
include/stop_slave_sql.inc
[connection master]
SET GLOBAL DEBUG= @saved_debug;
[connection slave]
#
# 5) Verify that appropriate messages are logged into master's and slave's
# error log.
#
include/assert_grep.inc [Found a message about the long GTIDs in the slave error log.]
#
# 6) Verify that replication succeeds if it tries to connect using CHANGE
# MASTER TO MASTER_LOG_POS.
#
CHANGE REPLICATION SOURCE TO SOURCE_LOG_FILE = 'MASTER_FILE', SOURCE_LOG_POS = MASTER_POS, SOURCE_AUTO_POSITION = 0;
include/start_slave.inc
include/assert.inc [t1 should contain only one row with the value 2]
include/stop_slave.inc
include/assert_grep.inc [Found warning containing lost GTIDs in the master error log.]
include/assert_grep.inc [Found warning containing lost GTIDs in the slave error log.]
[connection master]
CALL mtr.add_suppression("Cannot replicate to server.*server has purged required binary logs.*");
[connection slave]
CALL mtr.add_suppression("Got fatal error 1236 from source.*Replicate the missing transactions from elsewhere");
#
# 7) Cleanup.
#
[connection slave]
RESET MASTER;
RESET SLAVE;
Warnings:
Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead
[connection master]
RESET MASTER;
[connection slave]
include/start_slave.inc
[connection master]
DROP TABLE t1;
include/sync_slave_sql_with_master.inc
include/rpl_end.inc
|