| 1 |
include/master-slave.inc |
| 2 |
Warnings: |
| 3 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 |
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. |
| 5 |
[connection master] |
| 6 |
# |
| 7 |
# 1. Setup: |
| 8 |
# Start the replica channel with GTID_ONLY=1 |
| 9 |
# Add some data in the source and replicate it |
| 10 |
# Restart the replica but don't start replication |
| 11 |
[connection slave] |
| 12 |
SET @@GLOBAL.replica_checkpoint_period= 1; |
| 13 |
CHANGE REPLICATION SOURCE TO REQUIRE_ROW_FORMAT = 1, GTID_ONLY = 1; |
| 14 |
include/start_slave.inc |
| 15 |
include/assert.inc ['GTID_ONLY is enabled'] |
| 16 |
[connection master] |
| 17 |
CREATE TABLE t(s INT); |
| 18 |
INSERT INTO t VALUES(1); |
| 19 |
include/sync_slave_sql_with_master.inc |
| 20 |
include/rpl_restart_server.inc [server_number=2 parameters: --skip_slave_start] |
| 21 |
# |
| 22 |
# 2 Assert all invalid positions in SHOW REPLICA STATUS are shown as such |
| 23 |
include/assert.inc [The source log file name is invalid] |
| 24 |
include/assert.inc [The source log file position is 0] |
| 25 |
include/assert.inc [The source log file name in the applier is invalid] |
| 26 |
include/assert.inc [The source log file position in the applier is 0] |
| 27 |
# |
| 28 |
# 3 Start the replica IO thread. |
| 29 |
# Check receiver positions are now valid |
| 30 |
include/start_slave_io.inc |
| 31 |
include/assert.inc [The source log file name is back to the previous value] |
| 32 |
include/assert.inc [The source log file is back to the previous position] |
| 33 |
# |
| 34 |
# 4 Start the replica SQL thread and replicate a transaction |
| 35 |
# Check applier positions in relation to the source are now valid |
| 36 |
SET @@GLOBAL.replica_checkpoint_period= 1; |
| 37 |
include/start_slave_sql.inc |
| 38 |
[connection master] |
| 39 |
INSERT INTO t VALUES(2); |
| 40 |
include/sync_slave_sql_with_master.inc |
| 41 |
[connection master] |
| 42 |
[connection slave] |
| 43 |
include/assert.inc [The source log file name for the applier is the one used on the source] |
| 44 |
include/assert.inc [The source log file position in the applier is last applied on the source] |
| 45 |
# |
| 46 |
# 5 Check the starting SQL thread message reports invalid positions |
| 47 |
include/assert_grep.inc [The SQL thread start will report the information in relation to the source as invalid] |
| 48 |
# |
| 49 |
# 6 Cleanup |
| 50 |
SET @@GLOBAL.replica_checkpoint_period= REPLICA_CHECKPOINT_PERIOD; |
| 51 |
include/stop_slave.inc |
| 52 |
CHANGE REPLICATION SOURCE TO REQUIRE_ROW_FORMAT = 0, GTID_ONLY = 0; |
| 53 |
include/start_slave.inc |
| 54 |
[connection master] |
| 55 |
DROP TABLE t; |
| 56 |
include/rpl_end.inc |