|
| 1 | +include/group_replication.inc [rpl_server_count=6] |
| 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 master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. |
| 5 | +[connection server1] |
| 6 | + |
| 7 | +################################################################# |
| 8 | +# 1. Setup Group Replication on M1 and M2 and create group GR1. |
| 9 | +SET @@GLOBAL.group_replication_group_seeds= ""; |
| 10 | +include/start_and_bootstrap_group_replication.inc |
| 11 | +SET @@GLOBAL.group_replication_group_seeds= "GROUP_REPLICATION_GROUP_SEEDS"; |
| 12 | +include/start_group_replication.inc |
| 13 | +include/rpl_gr_wait_for_number_of_members.inc |
| 14 | + |
| 15 | +################################################################# |
| 16 | +# 2. Setup Group Replication on M1 and M2 and create group GR2. |
| 17 | +SET @@GLOBAL.group_replication_group_seeds= ""; |
| 18 | +include/start_and_bootstrap_group_replication.inc |
| 19 | +SET @@GLOBAL.group_replication_group_seeds= "GROUP_REPLICATION_GROUP_SEEDS"; |
| 20 | +include/start_group_replication.inc |
| 21 | +include/rpl_gr_wait_for_number_of_members.inc |
| 22 | + |
| 23 | +############################################################### |
| 24 | +# 3. Setup a asynchronous replication connection from M3 (GR2) |
| 25 | +# to M1 (GR1). |
| 26 | +CHANGE MASTER TO MASTER_HOST="127.0.0.1", MASTER_USER="root", MASTER_PASSWORD="", MASTER_PORT=SERVER_3_PORT, MASTER_AUTO_POSITION=1; |
| 27 | +Warnings: |
| 28 | +Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 29 | +Note 1760 Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. |
| 30 | +include/start_slave.inc |
| 31 | + |
| 32 | +############################################################### |
| 33 | +# 4. Setup a asynchronous replication connection from M1 (GR1) |
| 34 | +# to M3 (GR2). |
| 35 | +CHANGE MASTER TO MASTER_HOST="127.0.0.1", MASTER_USER="root", MASTER_PASSWORD="", MASTER_PORT=SERVER_1_PORT, MASTER_AUTO_POSITION=1; |
| 36 | +Warnings: |
| 37 | +Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 38 | +Note 1760 Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. |
| 39 | +include/start_slave.inc |
| 40 | + |
| 41 | +############################################################### |
| 42 | +# 5. Test view change issue by adding/dropping nodes from the |
| 43 | +# groups (just to generate more VIEW_EVENTs). |
| 44 | +# 5.1. Add a node M5 to group (GR1). |
| 45 | +SET @@GLOBAL.group_replication_group_seeds= "GROUP_REPLICATION_GROUP_SEEDS"; |
| 46 | +include/start_group_replication.inc |
| 47 | +include/rpl_gr_wait_for_number_of_members.inc |
| 48 | + |
| 49 | +################################################################ |
| 50 | +# 5.2. Add and immediately drop a node M6 to group (GR2). |
| 51 | +SET @@GLOBAL.group_replication_group_seeds= "GROUP_REPLICATION_GROUP_SEEDS"; |
| 52 | +include/start_group_replication.inc |
| 53 | +include/rpl_gr_wait_for_number_of_members.inc |
| 54 | +include/stop_group_replication.inc |
| 55 | + |
| 56 | +############################################################ |
| 57 | +# 6. Execute some transactions on M3 (GR2). |
| 58 | +CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; |
| 59 | +INSERT INTO t1 VALUES (0); |
| 60 | +INSERT INTO t1 VALUES (1); |
| 61 | +UPDATE t1 SET c1=2 WHERE c1=0; |
| 62 | +DELETE FROM t1 WHERE c1=1; |
| 63 | + |
| 64 | +############################################################ |
| 65 | +# 7. Wait until transactions executed on M3 are applied |
| 66 | +# on all nodes in both groups. |
| 67 | +include/sync_slave_sql_with_master.inc |
| 68 | +include/sync_slave_sql_with_master.inc |
| 69 | +include/sync_slave_sql_with_master.inc |
| 70 | +include/sync_slave_sql_with_master.inc |
| 71 | + |
| 72 | +############################################################ |
| 73 | +# 8. Execute some transactions on M1 (GR1). |
| 74 | +CREATE TABLE t2 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; |
| 75 | +INSERT INTO t2 VALUES (0); |
| 76 | +INSERT INTO t2 VALUES (1); |
| 77 | +UPDATE t2 SET c1=2 WHERE c1=0; |
| 78 | +DELETE FROM t2 WHERE c1=1; |
| 79 | + |
| 80 | +############################################################ |
| 81 | +# 9. Wait until transactions executed on M1 are applied |
| 82 | +# on all nodes in both groups. |
| 83 | +include/sync_slave_sql_with_master.inc |
| 84 | +include/sync_slave_sql_with_master.inc |
| 85 | +include/sync_slave_sql_with_master.inc |
| 86 | +include/sync_slave_sql_with_master.inc |
| 87 | + |
| 88 | +######################################################################### |
| 89 | +# 10. Validate data on all nodes (M1, M2, M3, M4 and M5) |
| 90 | +include/diff_tables.inc [server_1:t1, server_2:t1, server_3:t1, server_4:t1, server_5:t1] |
| 91 | +include/diff_tables.inc [server_1:t2, server_2:t2, server_3:t2, server_4:t2, server_5:t2] |
| 92 | + |
| 93 | +######################################################################### |
| 94 | +# 11. Check that GTID_EXECUTED on all servers are as expected. |
| 95 | +SET SESSION sql_log_bin= 0; |
| 96 | +include/gtid_utils.inc |
| 97 | +SET SESSION sql_log_bin= 1; |
| 98 | +include/assert.inc [Check that GTID_EXECUTED set on all servers are as expected.] |
| 99 | +SET SESSION sql_log_bin= 0; |
| 100 | +include/gtid_utils_end.inc |
| 101 | +SET SESSION sql_log_bin= 1; |
| 102 | +SET SESSION sql_log_bin= 0; |
| 103 | +include/gtid_utils.inc |
| 104 | +SET SESSION sql_log_bin= 1; |
| 105 | +include/assert.inc [Check that GTID_EXECUTED set on all servers are as expected.] |
| 106 | +SET SESSION sql_log_bin= 0; |
| 107 | +include/gtid_utils_end.inc |
| 108 | +SET SESSION sql_log_bin= 1; |
| 109 | +SET SESSION sql_log_bin= 0; |
| 110 | +include/gtid_utils.inc |
| 111 | +SET SESSION sql_log_bin= 1; |
| 112 | +include/assert.inc [Check that GTID_EXECUTED set on all servers are as expected.] |
| 113 | +SET SESSION sql_log_bin= 0; |
| 114 | +include/gtid_utils_end.inc |
| 115 | +SET SESSION sql_log_bin= 1; |
| 116 | +SET SESSION sql_log_bin= 0; |
| 117 | +include/gtid_utils.inc |
| 118 | +SET SESSION sql_log_bin= 1; |
| 119 | +include/assert.inc [Check that GTID_EXECUTED set on all servers are as expected.] |
| 120 | +SET SESSION sql_log_bin= 0; |
| 121 | +include/gtid_utils_end.inc |
| 122 | +SET SESSION sql_log_bin= 1; |
| 123 | +SET SESSION sql_log_bin= 0; |
| 124 | +include/gtid_utils.inc |
| 125 | +SET SESSION sql_log_bin= 1; |
| 126 | +include/assert.inc [Check that GTID_EXECUTED set on all servers are as expected.] |
| 127 | +SET SESSION sql_log_bin= 0; |
| 128 | +include/gtid_utils_end.inc |
| 129 | +SET SESSION sql_log_bin= 1; |
| 130 | + |
| 131 | +############################################################ |
| 132 | +# 12. Clean data. |
| 133 | +DROP TABLE t1; |
| 134 | +DROP TABLE t2; |
| 135 | +include/sync_slave_sql_with_master.inc |
| 136 | +include/sync_slave_sql_with_master.inc |
| 137 | +include/sync_slave_sql_with_master.inc |
| 138 | +include/sync_slave_sql_with_master.inc |
| 139 | + |
| 140 | +############################################################## |
| 141 | +# 13. Stop asynchronous replication between M3->M1 and M1->M3. |
| 142 | +include/stop_slave.inc |
| 143 | +CHANGE MASTER TO MASTER_AUTO_POSITION=0 FOR CHANNEL ""; |
| 144 | +include/stop_slave.inc |
| 145 | +CHANGE MASTER TO MASTER_AUTO_POSITION=0 FOR CHANNEL ""; |
| 146 | + |
| 147 | +############################################################ |
| 148 | +# 14. Stop Group Replication on all 5 nodes. |
| 149 | +include/stop_group_replication.inc |
| 150 | +include/stop_group_replication.inc |
| 151 | +include/stop_group_replication.inc |
| 152 | +include/stop_group_replication.inc |
| 153 | +include/stop_group_replication.inc |
| 154 | +include/group_replication_end.inc |
0 commit comments