| 1 |
################################################################################ |
| 2 |
# When using the MySQL communication stack, if we start two mysqls in the same |
| 3 |
# physical server and we misconfigure them by provinding the same local_address |
| 4 |
# to both, START GROUP_REPLICATION must fail with an appropriate ERROR. |
| 5 |
# This can only happen with the MySQL communication stack, because if we use |
| 6 |
# XCom, we will observe an error when we try to bind to the same address. |
| 7 |
# |
| 8 |
# |
| 9 |
# Test: |
| 10 |
# 0. The test requires two servers: M1 and M2 and can only run with MySQL stack |
| 11 |
# 1. Skip the group start |
| 12 |
# 2. Start and bootstrap the group with server 1 |
| 13 |
# 3. Change server 2 group_replication_local_address to be the same as server 1 |
| 14 |
# 4. Manually start server 2 and expect it to fail while joining the group |
| 15 |
# 5. Restore server 2 original address |
| 16 |
# 6. Server 2 must successfully join the group |
| 17 |
# 7. Clean up. |
| 18 |
# |
| 19 |
################################################################################ |
| 20 |
|
| 21 |
--source include/have_group_replication_mysql_communication_stack.inc |
| 22 |
--source include/have_group_replication_plugin.inc |
| 23 |
|
| 24 |
--echo # 1. Skip the group start |
| 25 |
--let $rpl_skip_group_replication_start= 1 |
| 26 |
--source include/group_replication.inc |
| 27 |
|
| 28 |
--echo # 2. Start and bootstrap the group with server 1 |
| 29 |
--let $rpl_connection_name= server1 |
| 30 |
--source include/rpl_connection.inc |
| 31 |
--source include/start_and_bootstrap_group_replication.inc |
| 32 |
|
| 33 |
--let $server_1_local_address= `SELECT @@GLOBAL.group_replication_local_address` |
| 34 |
|
| 35 |
--echo # 3. Change server 2 group_replication_local_address to be the same as |
| 36 |
--echo # server 1 |
| 37 |
--let $rpl_connection_name= server2 |
| 38 |
--source include/rpl_connection.inc |
| 39 |
|
| 40 |
# Adding suppressions |
| 41 |
SET SESSION sql_log_bin= 0; |
| 42 |
call mtr.add_suppression("\\[GCS\\] Error connecting to all peers. Member join failed. Local port:*"); |
| 43 |
call mtr.add_suppression("\\[GCS\\] The member was unable to join the group.*"); |
| 44 |
call mtr.add_suppression("Timeout on wait for view after joining group"); |
| 45 |
SET SESSION sql_log_bin= 1; |
| 46 |
|
| 47 |
SET @local_address_save= @@GLOBAL.group_replication_local_address; |
| 48 |
--replace_result $server_1_local_address GROUP_REPLICATION_SERVER_1_ADDRESS |
| 49 |
--eval SET GLOBAL group_replication_local_address= "$server_1_local_address" |
| 50 |
|
| 51 |
--echo # 4. Manually start server 2 and expect it to fail while joining the |
| 52 |
--echo # group |
| 53 |
|
| 54 |
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME |
| 55 |
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name" |
| 56 |
|
| 57 |
--error ER_GROUP_REPLICATION_CONFIGURATION |
| 58 |
START GROUP_REPLICATION; |
| 59 |
|
| 60 |
--echo # 5. Restore server 2 original address |
| 61 |
SET @@GLOBAL.group_replication_local_address= @local_address_save; |
| 62 |
|
| 63 |
--echo # 6. Server 2 must successfully join the group |
| 64 |
--source include/start_group_replication.inc |
| 65 |
|
| 66 |
--echo # 7. Clean up. |
| 67 |
|
| 68 |
# This is the end... My only friend the end! |
| 69 |
--source include/group_replication_end.inc |