| 1 |
include/group_replication.inc [rpl_server_count=3] |
| 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 server1] |
| 6 |
|
| 7 |
# 1. Bootstrap group replication on server1 with 8.0.12 version. |
| 8 |
set session sql_log_bin=0; |
| 9 |
call mtr.add_suppression("The function 'group_replication_switch_to_multi_primary_mode' failed. The group has a member with a version that does not support group coordinated operations."); |
| 10 |
set session sql_log_bin=1; |
| 11 |
SET @debug1_save= @@GLOBAL.DEBUG; |
| 12 |
SET @@GLOBAL.DEBUG= '+d,group_replication_legacy_election_version'; |
| 13 |
include/start_and_bootstrap_group_replication.inc |
| 14 |
|
| 15 |
# 2. Configure server2 with 8.0.12 version, and start group replication |
| 16 |
[connection server2] |
| 17 |
set session sql_log_bin=0; |
| 18 |
call mtr.add_suppression("Error while executing a group configuration operation: The group has a member with a version that does not support group coordinated operations."); |
| 19 |
set session sql_log_bin=1; |
| 20 |
SET @debug2_save= @@GLOBAL.DEBUG; |
| 21 |
SET @@GLOBAL.DEBUG= '+d,group_replication_legacy_election_version'; |
| 22 |
include/start_group_replication.inc |
| 23 |
|
| 24 |
# 3. Start group replication on server3 with a higher weight |
| 25 |
[connection server3] |
| 26 |
SET GLOBAL group_replication_member_weight= 90; |
| 27 |
set session sql_log_bin=0; |
| 28 |
call mtr.add_suppression("Member version is read compatible with the group."); |
| 29 |
set session sql_log_bin=1; |
| 30 |
include/start_group_replication.inc |
| 31 |
|
| 32 |
# 4. Stop group replication on server1 to force election of a new primary |
| 33 |
[connection server1] |
| 34 |
include/stop_group_replication.inc |
| 35 |
|
| 36 |
# 5. Check server3 is the primary and server2 the secondary |
| 37 |
[connection server3] |
| 38 |
include/gr_assert_primary_member.inc |
| 39 |
[connection server2] |
| 40 |
include/gr_assert_secondary_member.inc |
| 41 |
|
| 42 |
# 6. Increase the weight on server2 |
| 43 |
SET GLOBAL group_replication_member_weight= 95; |
| 44 |
|
| 45 |
# 7. Start group replication on server1 |
| 46 |
[connection server1] |
| 47 |
include/start_group_replication.inc |
| 48 |
|
| 49 |
# 8. Stop group replication on server3 to force election of a new primary |
| 50 |
[connection server3] |
| 51 |
include/stop_group_replication.inc |
| 52 |
|
| 53 |
# 9. Check server2 is the primary and server1 the secondary |
| 54 |
[connection server2] |
| 55 |
include/gr_assert_primary_member.inc |
| 56 |
[connection server1] |
| 57 |
include/gr_assert_secondary_member.inc |
| 58 |
|
| 59 |
# 10. Check the messages logged were for legacy elections. |
| 60 |
include/assert_grep.inc [Found the messages for two elections] |
| 61 |
|
| 62 |
# 11. Check also that an action cannot be executed |
| 63 |
# when a member with an older version is present. |
| 64 |
SELECT group_replication_switch_to_multi_primary_mode(); |
| 65 |
ERROR HY000: The function 'group_replication_switch_to_multi_primary_mode' failed. The group has a member with a version that does not support group coordinated operations. |
| 66 |
|
| 67 |
# 12. Cleanup |
| 68 |
SET @@GLOBAL.DEBUG= @debug1_save; |
| 69 |
[connection server2] |
| 70 |
include/stop_group_replication.inc |
| 71 |
SET @@GLOBAL.DEBUG= @debug2_save; |
| 72 |
SET @@GLOBAL.group_replication_member_weight= DEFAULT; |
| 73 |
[connection server3] |
| 74 |
SET @@GLOBAL.group_replication_member_weight= DEFAULT; |
| 75 |
include/group_replication_end.inc |