| 1 |
############################################################################### |
| 2 |
# This test verifies that cloning works with replication channel failover when |
| 3 |
# the member auto rejoins the group after an issue. |
| 4 |
# |
| 5 |
# 0. This test requires 4 servers server1, server2, server3 and server4 |
| 6 |
# (source). |
| 7 |
# 1. Install clone plugin on server1. |
| 8 |
# 2. Create replication channel ch1 |
| 9 |
# with SOURCE_CONNECTION_AUTO_FAILOVER enabled. |
| 10 |
# And verify managed channel and non-managed source addition |
| 11 |
# is successful in failover tables. |
| 12 |
# 3. Bootstrap server1 and add some data |
| 13 |
# Verify channel 'ch1' is running. |
| 14 |
# 4. Install the clone plugin and start GR on server3 |
| 15 |
# 5. Create replication channel ch1 |
| 16 |
# with SOURCE_CONNECTION_AUTO_FAILOVER enabled. |
| 17 |
# And verify managed channel and non-managed source synced |
| 18 |
# is successful to failover tables. |
| 19 |
# 6. Restart server 2 with a monitoring process (mysqld_safe) |
| 20 |
# 7. Setup server2 so group replication starts on boot |
| 21 |
# Install the Clone plugin |
| 22 |
# 8. On a empty server2 start group replication |
| 23 |
# Wait for it to restart and come back |
| 24 |
# Check clone was completed |
| 25 |
# 9. Verify data has been properly cloned in server2. |
| 26 |
# 10. Get server2 expelled. |
| 27 |
# 11. Add more data and new source to failover table |
| 28 |
# on server 1 before server2 rejoins. |
| 29 |
# 12. Unblock the rejoin, another clone should happen |
| 30 |
# 13. Verify if the data and failover tables |
| 31 |
# has been properly cloned in server2. |
| 32 |
# 14. Stop the replication channel 'ch1' on server1, and change |
| 33 |
# primary to server2. The asynchronous replication channel (ch1) |
| 34 |
# connection will be started without any error. |
| 35 |
# 15. Cleanup |
| 36 |
# |
| 37 |
|
| 38 |
--source include/big_test.inc |
| 39 |
--source include/have_debug_sync.inc |
| 40 |
--source include/linux.inc |
| 41 |
--source include/have_mysqld_monitoring_process.inc |
| 42 |
--source include/have_clone_plugin.inc |
| 43 |
--source include/have_group_replication_plugin.inc |
| 44 |
--let $rpl_server_count= 4 |
| 45 |
|
| 46 |
--let $rpl_skip_group_replication_start= 1 |
| 47 |
--source include/group_replication.inc |
| 48 |
|
| 49 |
|
| 50 |
# Get address and UUID of all servers |
| 51 |
--let $local_address_server1= `SELECT @@GLOBAL.group_replication_local_address` |
| 52 |
|
| 53 |
--let $rpl_connection_name= server2 |
| 54 |
--source include/rpl_connection.inc |
| 55 |
--let $local_address_server2= `SELECT @@GLOBAL.group_replication_local_address` |
| 56 |
|
| 57 |
--let $rpl_connection_name= server3 |
| 58 |
--source include/rpl_connection.inc |
| 59 |
--let $local_address_server3= `SELECT @@GLOBAL.group_replication_local_address` |
| 60 |
|
| 61 |
|
| 62 |
--echo |
| 63 |
--echo # 1. Install clone plugin on server1. |
| 64 |
--echo |
| 65 |
--let $rpl_connection_name= server1 |
| 66 |
--source include/rpl_connection.inc |
| 67 |
|
| 68 |
--replace_result $CLONE_PLUGIN CLONE_PLUGIN |
| 69 |
--eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN' |
| 70 |
|
| 71 |
|
| 72 |
--echo |
| 73 |
--echo # 2. Create replication channel ch1 |
| 74 |
--echo # with SOURCE_CONNECTION_AUTO_FAILOVER enabled. |
| 75 |
--echo # And verify managed channel and non-managed source addition |
| 76 |
--echo # is successful in failover tables. |
| 77 |
--echo |
| 78 |
--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4 |
| 79 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='root', SOURCE_AUTO_POSITION=1, SOURCE_CONNECTION_AUTO_FAILOVER=1, SOURCE_PORT=$SERVER_MYPORT_4, SOURCE_CONNECT_RETRY=1, SOURCE_RETRY_COUNT=1 FOR CHANNEL 'ch1' |
| 80 |
|
| 81 |
--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4 |
| 82 |
--eval SELECT asynchronous_connection_failover_add_source('ch1', '127.0.0.1', $SERVER_MYPORT_4, '', 90) |
| 83 |
SELECT asynchronous_connection_failover_add_managed('ch1', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '10.0.0.2', 3306, '', 80, 70); |
| 84 |
|
| 85 |
--let $assert_text= 'There are 2 rows in performance_schema.replication_asynchronous_connection_failover' |
| 86 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 2 |
| 87 |
--source include/assert.inc |
| 88 |
|
| 89 |
--let $assert_text= 'The version of replication_asynchronous_connection_failover must be 2' |
| 90 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_asynchronous_connection_failover\', version, 1] = 2 |
| 91 |
--source include/assert.inc |
| 92 |
|
| 93 |
--let $assert_text= 'There is 1 row in performance_schema.replication_asynchronous_connection_failover_managed' |
| 94 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 1 |
| 95 |
--source include/assert.inc |
| 96 |
|
| 97 |
--let $assert_text= 'The version of replication_asynchronous_connection_failover_managed must be 1' |
| 98 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_asynchronous_connection_failover_managed\', version, 1] = 1 |
| 99 |
--source include/assert.inc |
| 100 |
|
| 101 |
--let $assert_text= 'SOURCE_CONNECTION_AUTO_FAILOVER must be enabled on ch1' |
| 102 |
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_configuration WHERE CHANNEL_NAME="ch1" AND SOURCE_CONNECTION_AUTO_FAILOVER=1, count, 1] = 1 |
| 103 |
--source include/assert.inc |
| 104 |
|
| 105 |
|
| 106 |
--echo |
| 107 |
--echo # 3. Bootstrap server1 and add some data |
| 108 |
--echo # Verify channel 'ch1' is running. |
| 109 |
--echo |
| 110 |
|
| 111 |
--replace_result $local_address_server1 LOCAL_ADDRESS_SERVER1 $local_address_server2 LOCAL_ADDRESS_SERVER2 $local_address_server3 LOCAL_ADDRESS_SERVER3 |
| 112 |
--eval SET GLOBAL GROUP_REPLICATION_GROUP_SEEDS= "$local_address_server1, $local_address_server2, $local_address_server3" |
| 113 |
|
| 114 |
--source include/start_and_bootstrap_group_replication.inc |
| 115 |
|
| 116 |
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; |
| 117 |
INSERT INTO t1 VALUES (1); |
| 118 |
INSERT INTO t1 VALUES (2); |
| 119 |
|
| 120 |
|
| 121 |
--let $assert_text= 'CHANNEL ch1 is running' |
| 122 |
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_status WHERE CHANNEL_NAME="ch1" AND SERVICE_STATE="ON", count, 1] = 1 |
| 123 |
--source include/assert.inc |
| 124 |
|
| 125 |
|
| 126 |
--echo |
| 127 |
--echo # 4. Install the clone plugin and start GR on server3 |
| 128 |
--echo |
| 129 |
--let $rpl_connection_name= server3 |
| 130 |
--source include/rpl_connection.inc |
| 131 |
|
| 132 |
--replace_result $CLONE_PLUGIN CLONE_PLUGIN |
| 133 |
--eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN' |
| 134 |
|
| 135 |
|
| 136 |
--echo |
| 137 |
--echo # 5. Create replication channel ch1 |
| 138 |
--echo # with SOURCE_CONNECTION_AUTO_FAILOVER enabled. |
| 139 |
--echo # And verify managed channel and non-managed source synced |
| 140 |
--echo # is successful to failover tables. |
| 141 |
--echo |
| 142 |
--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4 |
| 143 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='root', SOURCE_AUTO_POSITION=1, SOURCE_CONNECTION_AUTO_FAILOVER=0, SOURCE_PORT=$SERVER_MYPORT_4, SOURCE_CONNECT_RETRY=1, SOURCE_RETRY_COUNT=1 FOR CHANNEL 'ch1' |
| 144 |
|
| 145 |
--replace_result $local_address_server1 LOCAL_ADDRESS_SERVER1 $local_address_server2 LOCAL_ADDRESS_SERVER2 $local_address_server3 LOCAL_ADDRESS_SERVER3 |
| 146 |
--eval SET GLOBAL GROUP_REPLICATION_GROUP_SEEDS= "$local_address_server1, $local_address_server2, $local_address_server3" |
| 147 |
--source include/start_group_replication.inc |
| 148 |
|
| 149 |
|
| 150 |
--let $assert_text= 'There are 2 rows in performance_schema.replication_asynchronous_connection_failover' |
| 151 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 2 |
| 152 |
--source include/assert.inc |
| 153 |
|
| 154 |
--let $assert_text= 'The version of replication_asynchronous_connection_failover must be 2' |
| 155 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_asynchronous_connection_failover\', version, 1] = 2 |
| 156 |
--source include/assert.inc |
| 157 |
|
| 158 |
--let $assert_text= 'There is 1 row in performance_schema.replication_asynchronous_connection_failover_managed' |
| 159 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 1 |
| 160 |
--source include/assert.inc |
| 161 |
|
| 162 |
--let $assert_text= 'The version of replication_asynchronous_connection_failover_managed must be 1' |
| 163 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_asynchronous_connection_failover_managed\', version, 1] = 1 |
| 164 |
--source include/assert.inc |
| 165 |
|
| 166 |
--let $assert_text= 'SOURCE_CONNECTION_AUTO_FAILOVER must be enabled for ch1' |
| 167 |
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_configuration WHERE CHANNEL_NAME="ch1" AND SOURCE_CONNECTION_AUTO_FAILOVER=1, count, 1] = 1 |
| 168 |
--source include/assert.inc |
| 169 |
|
| 170 |
|
| 171 |
--echo |
| 172 |
--echo # 6. Restart server 2 with a monitoring process (mysqld_safe) |
| 173 |
--echo |
| 174 |
--let $rpl_connection_name= server2 |
| 175 |
--source include/rpl_connection.inc |
| 176 |
|
| 177 |
CHANGE REPLICATION SOURCE TO SOURCE_HOST='10.0.0.1', SOURCE_USER='root', SOURCE_AUTO_POSITION=1, SOURCE_CONNECTION_AUTO_FAILOVER=0, SOURCE_PORT=3306, SOURCE_CONNECT_RETRY=1, SOURCE_RETRY_COUNT=1 FOR CHANNEL 'ch1'; |
| 178 |
|
| 179 |
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address` |
| 180 |
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds` |
| 181 |
--let $_group_replication_comm_stack= `SELECT @@GLOBAL.group_replication_communication_stack` |
| 182 |
|
| 183 |
# after the restart with mysqld_safe we need this option for expel operations |
| 184 |
SET PERSIST local_infile= ON; |
| 185 |
|
| 186 |
--let $plugin_list= $GROUP_REPLICATION |
| 187 |
--source include/spawn_monitoring_process.inc |
| 188 |
|
| 189 |
|
| 190 |
--echo |
| 191 |
--echo # 7. Setup server2 so group replication starts on boot |
| 192 |
--echo # Install the Clone plugin |
| 193 |
--echo |
| 194 |
--disable_query_log |
| 195 |
--eval SET PERSIST group_replication_group_name= "$group_replication_group_name" |
| 196 |
--eval SET PERSIST group_replication_local_address= "$_group_replication_local_address" |
| 197 |
--eval SET PERSIST group_replication_group_seeds= "$_group_replication_group_seeds" |
| 198 |
--eval SET PERSIST group_replication_communication_stack= "$_group_replication_comm_stack" |
| 199 |
|
| 200 |
SET PERSIST group_replication_enforce_update_everywhere_checks=FALSE; |
| 201 |
SET PERSIST group_replication_single_primary_mode=TRUE; |
| 202 |
SET PERSIST group_replication_start_on_boot= ON; |
| 203 |
--enable_query_log |
| 204 |
|
| 205 |
--replace_result $CLONE_PLUGIN CLONE_PLUGIN |
| 206 |
--eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN' |
| 207 |
|
| 208 |
|
| 209 |
--echo |
| 210 |
--echo # 8. On a empty server2 start group replication |
| 211 |
--echo # Wait for it to restart and come back |
| 212 |
--echo # Check clone was completed |
| 213 |
--echo |
| 214 |
--let $_group_replication_threshold_save= `SELECT @@GLOBAL.group_replication_clone_threshold` |
| 215 |
SET GLOBAL group_replication_clone_threshold= 1; |
| 216 |
|
| 217 |
|
| 218 |
--replace_result $local_address_server1 LOCAL_ADDRESS_SERVER1 $local_address_server2 LOCAL_ADDRESS_SERVER2 $local_address_server3 LOCAL_ADDRESS_SERVER3 |
| 219 |
--eval SET GLOBAL GROUP_REPLICATION_GROUP_SEEDS= "$local_address_server1, $local_address_server2, $local_address_server3" |
| 220 |
START GROUP_REPLICATION; |
| 221 |
|
| 222 |
--source include/wait_until_disconnected.inc |
| 223 |
|
| 224 |
--let $rpl_server_number= 2 |
| 225 |
--source include/rpl_reconnect.inc |
| 226 |
|
| 227 |
--let $group_replication_member_state=ONLINE |
| 228 |
--source include/gr_wait_for_member_state.inc |
| 229 |
|
| 230 |
--let $assert_text= Clone must be completed |
| 231 |
--let $assert_cond= [SELECT state="Completed" FROM performance_schema.clone_status] = 1; |
| 232 |
--source include/assert.inc |
| 233 |
|
| 234 |
|
| 235 |
--echo |
| 236 |
--echo # 9. Verify data has been properly cloned in server2. |
| 237 |
--echo |
| 238 |
--let $diff_tables=server1:test.t1, server2:test.t1, server3:test.t1 |
| 239 |
--source include/diff_tables.inc |
| 240 |
|
| 241 |
|
| 242 |
--let $assert_text= 'There are 2 rows in performance_schema.replication_asynchronous_connection_failover' |
| 243 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 2 |
| 244 |
--source include/assert.inc |
| 245 |
|
| 246 |
--let $assert_text= 'The version of replication_asynchronous_connection_failover must be 2' |
| 247 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_asynchronous_connection_failover\', version, 1] = 2 |
| 248 |
--source include/assert.inc |
| 249 |
|
| 250 |
--let $assert_text= 'There is 1 row in performance_schema.replication_asynchronous_connection_failover_managed' |
| 251 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 1 |
| 252 |
--source include/assert.inc |
| 253 |
|
| 254 |
--let $assert_text= 'The version of replication_asynchronous_connection_failover_managed must be 1' |
| 255 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_asynchronous_connection_failover_managed\', version, 1] = 1 |
| 256 |
--source include/assert.inc |
| 257 |
|
| 258 |
--let $assert_text= 'SOURCE_CONNECTION_AUTO_FAILOVER must be enabled for ch1' |
| 259 |
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_configuration WHERE CHANNEL_NAME="ch1" AND SOURCE_CONNECTION_AUTO_FAILOVER=1, count, 1] = 1 |
| 260 |
--source include/assert.inc |
| 261 |
|
| 262 |
|
| 263 |
--echo |
| 264 |
--echo # 10. Get server2 expelled. |
| 265 |
--echo |
| 266 |
--let $rpl_connection_name = server2 |
| 267 |
--source include/rpl_connection.inc |
| 268 |
|
| 269 |
SET GLOBAL super_read_only = 0; |
| 270 |
SET @debug_saved = @@GLOBAL.DEBUG; |
| 271 |
SET @@GLOBAL.DEBUG='+d,group_replication_stop_before_rejoin'; |
| 272 |
|
| 273 |
# Force expel on member 2 |
| 274 |
--let $member_id = `SELECT @@GLOBAL.server_uuid` |
| 275 |
--let $rpl_server_count= 3 |
| 276 |
--source include/gr_expel_member_from_group.inc |
| 277 |
SET GLOBAL super_read_only = 1; |
| 278 |
--let $rpl_server_count= 4 |
| 279 |
|
| 280 |
SET DEBUG_SYNC = "now WAIT_FOR signal.autorejoin_waiting"; |
| 281 |
|
| 282 |
# Verify that it is currently running |
| 283 |
--let $assert_text = Auto-rejoin should be running |
| 284 |
--let $assert_count_var = `SELECT COUNT(*) FROM performance_schema.events_stages_current WHERE EVENT_NAME LIKE '%auto-rejoin%'` |
| 285 |
--let $assert_cond = $assert_count_var = 1 |
| 286 |
--source include/assert.inc |
| 287 |
|
| 288 |
|
| 289 |
--echo |
| 290 |
--echo # 11. Add more data and new source to failover table |
| 291 |
--echo # on server 1 before server2 rejoins. |
| 292 |
--echo |
| 293 |
--let $rpl_connection_name = server1 |
| 294 |
--source include/rpl_connection.inc |
| 295 |
|
| 296 |
SELECT asynchronous_connection_failover_add_source('ch1', '10.0.0.1', 3307, '', 50); |
| 297 |
|
| 298 |
INSERT INTO t1 VALUES (3); |
| 299 |
INSERT INTO t1 VALUES (4); |
| 300 |
|
| 301 |
--let $assert_text= 'There are 3 rows in performance_schema.replication_asynchronous_connection_failover' |
| 302 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 3 |
| 303 |
--source include/assert.inc |
| 304 |
|
| 305 |
--let $assert_text= 'The version of replication_asynchronous_connection_failover must be 2' |
| 306 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_asynchronous_connection_failover\', version, 1] = 3 |
| 307 |
--source include/assert.inc |
| 308 |
|
| 309 |
|
| 310 |
--source include/rpl_sync.inc |
| 311 |
|
| 312 |
|
| 313 |
--echo |
| 314 |
--echo # 12. Unblock the rejoin, another clone should happen |
| 315 |
--echo |
| 316 |
--let $rpl_connection_name = server2 |
| 317 |
--source include/rpl_connection.inc |
| 318 |
|
| 319 |
SET GLOBAL group_replication_clone_threshold= 1; |
| 320 |
|
| 321 |
SET DEBUG_SYNC = "now SIGNAL signal.autorejoin_continue"; |
| 322 |
|
| 323 |
--source include/wait_until_disconnected.inc |
| 324 |
|
| 325 |
--let $rpl_server_number= 2 |
| 326 |
--source include/rpl_reconnect.inc |
| 327 |
|
| 328 |
--let $group_replication_member_state=ONLINE |
| 329 |
--source include/gr_wait_for_member_state.inc |
| 330 |
|
| 331 |
--let $assert_text= Clone must be completed |
| 332 |
--let $assert_cond= [SELECT state="Completed" FROM performance_schema.clone_status] = 1; |
| 333 |
--source include/assert.inc |
| 334 |
|
| 335 |
|
| 336 |
--echo |
| 337 |
--echo # 13. Verify if the data and failover tables |
| 338 |
--echo # has been properly cloned in server2. |
| 339 |
--echo |
| 340 |
--let $diff_tables=server1:test.t1, server2:test.t1, server3:test.t1 |
| 341 |
--source include/diff_tables.inc |
| 342 |
|
| 343 |
--let $assert_text= 'There are 3 rows in performance_schema.replication_asynchronous_connection_failover' |
| 344 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 3 |
| 345 |
--source include/assert.inc |
| 346 |
|
| 347 |
--let $assert_text= 'The version of replication_asynchronous_connection_failover must be 3' |
| 348 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_asynchronous_connection_failover\', version, 1] = 3 |
| 349 |
--source include/assert.inc |
| 350 |
|
| 351 |
--let $assert_text= 'There is 1 row in performance_schema.replication_asynchronous_connection_failover_managed' |
| 352 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 1 |
| 353 |
--source include/assert.inc |
| 354 |
|
| 355 |
--let $assert_text= 'The version of replication_asynchronous_connection_failover_managed must be 1' |
| 356 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_asynchronous_connection_failover_managed\', version, 1] = 1 |
| 357 |
--source include/assert.inc |
| 358 |
|
| 359 |
--let $assert_text= 'SOURCE_CONNECTION_AUTO_FAILOVER must be enabled for ch1' |
| 360 |
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_configuration WHERE CHANNEL_NAME="ch1" AND SOURCE_CONNECTION_AUTO_FAILOVER=1, count, 1] = 1 |
| 361 |
--source include/assert.inc |
| 362 |
|
| 363 |
|
| 364 |
--echo |
| 365 |
--echo # 14. Stop the replication channel 'ch1' on server1, and change |
| 366 |
--echo # primary to server2. The asynchronous replication channel (ch1) |
| 367 |
--echo # connection will be started without any error. |
| 368 |
--echo |
| 369 |
--let $server2_uuid= `SELECT @@server_uuid` |
| 370 |
|
| 371 |
--let $rpl_connection_name= server1 |
| 372 |
--source include/rpl_connection.inc |
| 373 |
|
| 374 |
--let $rpl_channel_name='ch1' |
| 375 |
--source include/stop_slave.inc |
| 376 |
|
| 377 |
--let $rpl_connection_name= server2 |
| 378 |
--source include/rpl_connection.inc |
| 379 |
|
| 380 |
--replace_result $server2_uuid SERVER2_UUID |
| 381 |
--eval SELECT group_replication_set_as_primary("$server2_uuid") |
| 382 |
|
| 383 |
--let $group_replication_expected_uuid= $server2_uuid |
| 384 |
--source include/gr_wait_primary_member_uuid.inc |
| 385 |
|
| 386 |
--let $wait_condition=SELECT COUNT(*)=3 FROM performance_schema.replication_group_members where MEMBER_STATE="ONLINE" |
| 387 |
--source include/wait_condition.inc |
| 388 |
|
| 389 |
--let $rpl_channel_name='ch1' |
| 390 |
--source include/wait_for_slave_to_start.inc |
| 391 |
|
| 392 |
--let $wait_condition= SELECT COUNT(*)=1 FROM performance_schema.replication_connection_configuration where CHANNEL_NAME='ch1' and HOST='127.0.0.1' and PORT=$SERVER_MYPORT_4 |
| 393 |
--source include/wait_condition.inc |
| 394 |
|
| 395 |
--let $wait_condition= SELECT COUNT(*)=1 FROM performance_schema.replication_connection_status where CHANNEL_NAME='ch1' and SERVICE_STATE='ON' |
| 396 |
--source include/wait_condition.inc |
| 397 |
|
| 398 |
--let $wait_condition= SELECT COUNT(*)=1 FROM performance_schema.replication_applier_status where CHANNEL_NAME='ch1' and SERVICE_STATE='ON' |
| 399 |
--source include/wait_condition.inc |
| 400 |
|
| 401 |
--let $assert_text= Verify replica_monitor thread is running |
| 402 |
--let $assert_cond= "[select count(*) FROM performance_schema.threads where NAME=\"thread/sql/replica_monitor\"]" = 1; |
| 403 |
--source include/assert.inc |
| 404 |
|
| 405 |
|
| 406 |
--echo |
| 407 |
--echo # 15. Cleanup |
| 408 |
--echo |
| 409 |
DROP TABLE t1; |
| 410 |
|
| 411 |
RESET PERSIST IF EXISTS group_replication_enforce_update_everywhere_checks; |
| 412 |
RESET PERSIST IF EXISTS group_replication_single_primary_mode; |
| 413 |
RESET PERSIST IF EXISTS group_replication_group_name; |
| 414 |
RESET PERSIST IF EXISTS group_replication_local_address; |
| 415 |
RESET PERSIST IF EXISTS group_replication_group_seeds; |
| 416 |
RESET PERSIST IF EXISTS group_replication_communication_stack; |
| 417 |
RESET PERSIST IF EXISTS group_replication_start_on_boot; |
| 418 |
RESET PERSIST IF EXISTS local_infile; |
| 419 |
|
| 420 |
--let $rpl_channel_name='ch1' |
| 421 |
--source include/stop_slave.inc |
| 422 |
|
| 423 |
--let $rpl_reset_slave_all= 1 |
| 424 |
--let $rpl_multi_source= 1 |
| 425 |
--source include/rpl_reset_slave.inc |
| 426 |
--let $rpl_channel_name= |
| 427 |
--let $rpl_reset_slave_all= |
| 428 |
--let $rpl_multi_source= |
| 429 |
|
| 430 |
|
| 431 |
--let $rpl_connection_name= server1 |
| 432 |
--source include/rpl_connection.inc |
| 433 |
--source include/stop_group_replication.inc |
| 434 |
UNINSTALL PLUGIN clone; |
| 435 |
|
| 436 |
--let $rpl_channel_name='ch1' |
| 437 |
--let $rpl_reset_slave_all= 1 |
| 438 |
--let $rpl_multi_source= 1 |
| 439 |
--source include/rpl_reset_slave.inc |
| 440 |
--let $rpl_channel_name= |
| 441 |
--let $rpl_reset_slave_all= |
| 442 |
--let $rpl_multi_source= |
| 443 |
|
| 444 |
set session sql_log_bin=0; |
| 445 |
call mtr.add_suppression("The Monitor IO thread failed to connect to the source .* for channel 'ch1', thence it will try to connect to another source."); |
| 446 |
set session sql_log_bin=1; |
| 447 |
|
| 448 |
|
| 449 |
--let $rpl_connection_name= server3 |
| 450 |
--source include/rpl_connection.inc |
| 451 |
--source include/stop_group_replication.inc |
| 452 |
UNINSTALL PLUGIN clone; |
| 453 |
|
| 454 |
--let $rpl_channel_name='ch1' |
| 455 |
--let $rpl_reset_slave_all= 1 |
| 456 |
--let $rpl_multi_source= 1 |
| 457 |
--source include/rpl_reset_slave.inc |
| 458 |
--let $rpl_channel_name= |
| 459 |
--let $rpl_reset_slave_all= |
| 460 |
--let $rpl_multi_source= |
| 461 |
|
| 462 |
|
| 463 |
--let $rpl_connection_name= server2 |
| 464 |
--source include/rpl_connection.inc |
| 465 |
|
| 466 |
--disable_query_log |
| 467 |
--eval SET GLOBAL group_replication_clone_threshold= $_group_replication_threshold_save |
| 468 |
--enable_query_log |
| 469 |
--source include/stop_group_replication.inc |
| 470 |
UNINSTALL PLUGIN clone; |
| 471 |
|
| 472 |
set session sql_log_bin=0; |
| 473 |
call mtr.add_suppression("Recovery from source pos .* and file .* for channel 'ch1'. Previous relay log pos and relay log file had been set to .* respectively."); |
| 474 |
call mtr.add_suppression("The Monitor IO thread failed to connect to the source .* for channel 'ch1', thence it will try to connect to another source."); |
| 475 |
call mtr.add_suppression("This member will start distributed recovery using clone. It is due to the number of missing transactions being higher than the configured threshold of*"); |
| 476 |
call mtr.add_suppression("Member was expelled from the group due to network failures, changing member status to ERROR."); |
| 477 |
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected."); |
| 478 |
call mtr.add_suppression("Started auto-rejoin procedure attempt*"); |
| 479 |
call mtr.add_suppression("Auto-rejoin procedure attempt 1 of 1"); |
| 480 |
call mtr.add_suppression("Clone removing all user data for provisioning: Started"); |
| 481 |
call mtr.add_suppression("Clone removing all user data for provisioning: Finished"); |
| 482 |
call mtr.add_suppression("Applier metadata information for channel 'ch1' was found after a clone operation. Relay log recovery will be executed to adjust positions .*"); |
| 483 |
call mtr.add_suppression("Error during .* Could not locate rotate event from the source."); |
| 484 |
call mtr.add_suppression("Server was not able to find a rotate event from source server to initialize relay log recovery for channel .*"); |
| 485 |
set session sql_log_bin=1; |
| 486 |
|
| 487 |
--source include/clean_monitoring_process.inc |
| 488 |
--source include/group_replication_end.inc |