| 1 |
# |
| 2 |
# 1. Set up source server_1 with server_2 being a replica. |
| 3 |
include/rpl_init.inc [topology=1->2] |
| 4 |
Warnings: |
| 5 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 6 |
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. |
| 7 |
# |
| 8 |
# 2. Create a table for testing |
| 9 |
[connection server_1] |
| 10 |
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; |
| 11 |
include/sync_slave_sql_with_master.inc [FOR CHANNEL 'channel_1'] |
| 12 |
# |
| 13 |
# 3. Configure ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS = LOCAL on server 2 |
| 14 |
# verify the UUID used while creating gtid_events from the corresponding |
| 15 |
# anonymous_gtid_event. |
| 16 |
# Install clone on server 2 |
| 17 |
# Configure server 3 to invoke clone |
| 18 |
[connection server_2] |
| 19 |
include/rpl_set_gtid_mode.inc [ON on servers 2] |
| 20 |
include/stop_slave.inc [FOR CHANNEL 'channel_1'] |
| 21 |
CHANGE REPLICATION SOURCE TO ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS = LOCAL for channel 'channel_1'; |
| 22 |
Warnings: |
| 23 |
Note 4017 Using ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS creates limitations on the replication topology - you cannot fail over between downstream and upstream servers. Only use this option if it is not possible to enable GTIDs on the source, for instance, because of lack of permissions. If possible, use the procedure for enabling GTID transactions online instead, as described in the documentation. |
| 24 |
include/start_slave.inc [FOR CHANNEL 'channel_1'] |
| 25 |
[connection server_1] |
| 26 |
INSERT INTO t1 VALUES(10); |
| 27 |
include/sync_slave_sql_with_master.inc [FOR CHANNEL 'channel_1'] |
| 28 |
include/gtid_step_assert.inc [count=1, only_count=1] |
| 29 |
INSTALL PLUGIN clone SONAME 'CLONE_PLUGIN'; |
| 30 |
[connection server_3] |
| 31 |
include/spawn_monitoring_process.inc |
| 32 |
INSTALL PLUGIN clone SONAME 'CLONE_PLUGIN'; |
| 33 |
SET GLOBAL clone_valid_donor_list = 'localhost:SERVER2_PORT'; |
| 34 |
CLONE INSTANCE FROM root@localhost:SERVER2_PORT IDENTIFIED BY ''; |
| 35 |
include/rpl_reconnect.inc |
| 36 |
# |
| 37 |
# Verify the UUID being used for converting Gtid event from |
| 38 |
# anonymous_gtid event. |
| 39 |
include/rpl_set_gtid_mode.inc [ON on servers 3] |
| 40 |
include/start_slave.inc |
| 41 |
[connection server_1] |
| 42 |
INSERT INTO t1 VALUES (1); |
| 43 |
include/sync_slave_sql_with_master.inc [FOR CHANNEL 'channel_1'] |
| 44 |
USE test; |
| 45 |
include/gtid_step_assert.inc [count=1, only_count=1] |
| 46 |
include/gtid_step_assert.inc [count=0, only_count=1] |
| 47 |
include/assert.inc [All info from server 1 is present] |
| 48 |
include/assert.inc [ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_VALUE_CHECK for channel_1 in performance_schema.replication_applier_configuration is ] |
| 49 |
include/assert.inc [Check entry for channel_1 in mysql.slave_relay_log_info] |
| 50 |
# |
| 51 |
# 8. Cleanup |
| 52 |
[connection server_1] |
| 53 |
DROP TABLE t1; |
| 54 |
include/sync_slave_sql_with_master.inc [FOR CHANNEL 'channel_1'] |
| 55 |
[connection server_1] |
| 56 |
include/sync_slave_sql_with_master.inc [FOR CHANNEL 'channel_1'] |
| 57 |
[connection server_2] |
| 58 |
include/stop_slave.inc [FOR CHANNEL 'channel_1'] |
| 59 |
CHANGE REPLICATION SOURCE TO ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS = OFF for channel 'channel_1'; |
| 60 |
include/rpl_set_gtid_mode.inc [OFF on servers 2] |
| 61 |
include/start_slave.inc [FOR CHANNEL 'channel_1'] |
| 62 |
UNINSTALL PLUGIN clone; |
| 63 |
[connection server_3] |
| 64 |
include/stop_slave.inc [FOR CHANNEL 'channel_1'] |
| 65 |
CHANGE REPLICATION SOURCE TO ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS = OFF for channel 'channel_1'; |
| 66 |
include/rpl_set_gtid_mode.inc [OFF on servers 3] |
| 67 |
include/start_slave.inc [FOR CHANNEL 'channel_1'] |
| 68 |
UNINSTALL PLUGIN clone; |
| 69 |
include/clean_monitoring_process.inc |
| 70 |
include/stop_slave.inc |
| 71 |
RESET SLAVE ALL; |
| 72 |
Warnings: |
| 73 |
Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead |
| 74 |
set session sql_log_bin=0; |
| 75 |
CALL mtr.add_suppression("Clone removing all user data for provisioning: Started"); |
| 76 |
CALL mtr.add_suppression("Clone removing all user data for provisioning: Finished"); |
| 77 |
CALL mtr.add_suppression("Recovery from source pos [0-9]+ and file [a-zA-Z-]+\.[0-9]+ for channel 'channel_1'*"); |
| 78 |
CALL mtr.add_suppression("Recovery from source pos [0-9]+ and file [a-zA-Z-]+\.[0-9]+ for channel 'channel_3'*"); |
| 79 |
CALL mtr.add_suppression("Applier metadata information for channel 'channel_1' was found after a clone operation. Relay log recovery*"); |
| 80 |
CALL mtr.add_suppression("Applier metadata information for channel 'channel_3' was found after a clone operation. Relay log recovery*"); |
| 81 |
CALL mtr.add_suppression("If you intend to use GTID_MODE = ON everywhere, change to ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS = OFF"); |
| 82 |
CALL mtr.add_suppression(".*Failed to initialize the connection metadata structure for channel.*"); |
| 83 |
CALL mtr.add_suppression("Error reading relay log configuration"); |
| 84 |
set session sql_log_bin=1; |
| 85 |
include/gtid_utils_end.inc |
| 86 |
include/rpl_end.inc |