| 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. Create a table on the source and replicate it. |
| 8 |
# Check the repo shows the same value as SHOW REPLICA STATUS |
| 9 |
[connection slave] |
| 10 |
SET @@GLOBAL.replica_checkpoint_period= 1; |
| 11 |
[connection master] |
| 12 |
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY); |
| 13 |
INSERT INTO t1 VALUES (1); |
| 14 |
include/sync_slave_sql_with_master.inc |
| 15 |
include/assert.inc [The repository has the lastest position] |
| 16 |
include/assert.inc [The file name for the repository and the show replica status match] |
| 17 |
# |
| 18 |
# 2. Stop replication and make the channel use GTID_ONLY=1 |
| 19 |
# Start replication and add some values to the table. |
| 20 |
# Check the repo shows the old values in relation to SHOW REPLICA STATUS |
| 21 |
include/stop_slave.inc |
| 22 |
CHANGE REPLICATION SOURCE TO GTID_ONLY = 1, REQUIRE_ROW_FORMAT=1; |
| 23 |
include/start_slave.inc |
| 24 |
[connection master] |
| 25 |
INSERT INTO t1 VALUES (2); |
| 26 |
include/sync_slave_sql_with_master.inc |
| 27 |
include/assert.inc [The repository position is not the one shown on show replica status] |
| 28 |
include/assert.inc [The repository pos value is still the same] |
| 29 |
include/assert.inc [The repository name value is still the same] |
| 30 |
# |
| 31 |
# 3. Stop replication |
| 32 |
# Check the repo still shows the old values in relation to SHOW REPLICA STATUS |
| 33 |
include/stop_slave.inc |
| 34 |
include/assert.inc [The repository position is not the one shown on show replica status] |
| 35 |
include/assert.inc [The repository pos value is still the same] |
| 36 |
include/assert.inc [The repository name value is still the same] |
| 37 |
# |
| 38 |
# 4. Start replication again |
| 39 |
# Check the repo still shows the old values in relation to SHOW REPLICA STATUS |
| 40 |
include/start_slave.inc |
| 41 |
[connection master] |
| 42 |
INSERT INTO t1 VALUES (3); |
| 43 |
include/sync_slave_sql_with_master.inc |
| 44 |
include/assert.inc [The repository position is not the one shown on show replica status] |
| 45 |
include/assert.inc [The repository file name is not the one shown on show replica status] |
| 46 |
include/assert.inc [The repository pos value is still the same] |
| 47 |
include/assert.inc [The repository name value is still the same] |
| 48 |
# |
| 49 |
# 5. Kill the SQL thread |
| 50 |
# Check the repo still shows the old values in relation to SHOW REPLICA STATUS |
| 51 |
include/wait_for_slave_sql_error.inc [errno=1756] |
| 52 |
include/assert.inc [The repository position is not the one shown on show replica status] |
| 53 |
include/assert.inc [The repository file name is not the one shown on show replica status] |
| 54 |
include/assert.inc [The repository pos value is still the same] |
| 55 |
include/assert.inc [The repository name value is still the same] |
| 56 |
# |
| 57 |
# 6. Change a replication connection setting with CHANGE REPLICATION SOURCE |
| 58 |
# Check the repo now has the same value in relation to SHOW REPLICA STATUS |
| 59 |
include/stop_slave.inc |
| 60 |
CHANGE REPLICATION SOURCE TO SOURCE_CONNECT_RETRY = 10000; |
| 61 |
include/assert.inc [The repository has the lastest position] |
| 62 |
include/assert.inc [The file name for the repository and the show replica status match] |
| 63 |
# |
| 64 |
# 7. Restart the replica server |
| 65 |
# Check the repo still shows the old values |
| 66 |
include/start_slave.inc |
| 67 |
[connection master] |
| 68 |
INSERT INTO t1 VALUES (4); |
| 69 |
include/sync_slave_sql_with_master.inc |
| 70 |
include/assert.inc [The repository position is not the one shown on show replica status] |
| 71 |
include/rpl_restart_server.inc [server_number=2 parameters: --skip_replica_start=FALSE] |
| 72 |
include/assert.inc [The repository pos value is still the same] |
| 73 |
# |
| 74 |
# 8. Add some values and check the repo is again stale |
| 75 |
# Execute a RESET REPLICA command |
| 76 |
# Check the repo persisted the reset position |
| 77 |
[connection master] |
| 78 |
INSERT INTO t1 VALUES (5); |
| 79 |
include/sync_slave_sql_with_master.inc |
| 80 |
include/assert.inc [The repository position is not the one shown on show replica status] |
| 81 |
include/stop_slave.inc |
| 82 |
RESET REPLICA; |
| 83 |
SELECT Relay_log_pos FROM mysql.slave_relay_log_info;; |
| 84 |
Relay_log_pos NULL |
| 85 |
0 |
| 86 |
|
| 87 |
include/assert.inc [The position was reset as shown on show replica status] |
| 88 |
include/assert.inc [The repository reset the position] |
| 89 |
# |
| 90 |
# 9. Check RESET REPLICA ALL removes all the information |
| 91 |
include/start_slave.inc |
| 92 |
[connection master] |
| 93 |
INSERT INTO t1 VALUES (6); |
| 94 |
include/sync_slave_sql_with_master.inc |
| 95 |
include/assert.inc [The repository position was persisted when the channel was initialized after the reset] |
| 96 |
include/stop_slave.inc |
| 97 |
RESET REPLICA ALL; |
| 98 |
include/assert.inc [The repository info was deleted] |
| 99 |
# |
| 100 |
# 10. Cleanup |
| 101 |
SET @@GLOBAL.replica_checkpoint_period=CHECKPOINT_PERIOD;; |
| 102 |
CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_PORT=MASTER_PORT, SOURCE_USER='root'; |
| 103 |
Warnings: |
| 104 |
Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 105 |
Note 1760 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. |
| 106 |
include/start_slave.inc |
| 107 |
call mtr.add_suppression("The replica coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); |
| 108 |
[connection master] |
| 109 |
DROP TABLE t1; |
| 110 |
include/rpl_end.inc |