1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
include/group_replication.inc [rpl_server_count=3]
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
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.
[connection server1]
# 1. Bootstrap M1.
# Start GR on M2 with higher weight and patch version.
[connection server1]
SET SESSION sql_log_bin=0;
call mtr.add_suppression("Error while executing a group configuration operation: Error processing configuration start message: The appointed primary member has a version that is greater than the one of some of the members in the group.");
SET SESSION sql_log_bin=1;
include/start_and_bootstrap_group_replication.inc
[connection server2]
SET @member_weight2_save= @@GLOBAL.group_replication_member_weight;
SET GLOBAL group_replication_member_weight= 90;
SET @debug2_save= @@GLOBAL.DEBUG;
SET @@GLOBAL.DEBUG= 'd,group_replication_compatibility_higher_patch_version';
SET SESSION sql_log_bin=0;
call mtr.add_suppression("Member version is read compatible with the group.");
call mtr.add_suppression("Error while executing a group configuration operation: Error processing configuration start message: The appointed primary member has a version that is greater than the one of some of the members in the group.");
call mtr.add_suppression("The function 'group_replication_switch_to_single_primary_mode' failed. Error processing configuration start message: The appointed primary member has a version that is greater than the one of some of the members in the group.");
SET SESSION sql_log_bin=1;
include/start_group_replication.inc
# 2. Set M2 as primary, it fails due to higher patch version.
SELECT group_replication_switch_to_single_primary_mode("MEMBER_UUID");;
ERROR HY000: The function 'group_replication_switch_to_single_primary_mode' failed. Error processing configuration start message: The appointed primary member has a version that is greater than the one of some of the members in the group.
include/gr_assert_mpm_consistency.inc
# 3. Switch to single-primary mode.
# M1 becomes primary due to lower version rule.
SELECT group_replication_switch_to_single_primary_mode();
group_replication_switch_to_single_primary_mode()
Mode switched to single-primary successfully.
include/gr_assert_spm_consistency.inc
# 4. Switch to multi-primary mode and start GR on M3.
SELECT group_replication_switch_to_multi_primary_mode();
group_replication_switch_to_multi_primary_mode()
Mode switched to multi-primary successfully.
[connection server3]
SET @member_weight3_save= @@GLOBAL.group_replication_member_weight;
SET SESSION sql_log_bin=0;
call mtr.add_suppression("The function 'group_replication_set_as_primary' failed. Error processing configuration start message: The appointed primary member has a version that is greater than the one of some of the members in the group.");
SET SESSION sql_log_bin=1;
include/start_group_replication.inc
include/gr_assert_mpm_consistency.inc
# 5. Switch to single primary mode holding elections.
# M2 is not considered due to higher patch version,
# even though it has higher member weight.
# M1 and M3 has same version and weight,
# lower server_uuid become primary.
# Assert configurations are correct.
SELECT group_replication_switch_to_single_primary_mode();
group_replication_switch_to_single_primary_mode()
Mode switched to single-primary successfully.
include/gr_assert_spm_consistency.inc
# 6. Change primary, UDF fails if new primary has higher version.
# Assert configurations are not changed.
SELECT group_replication_set_as_primary("MEMBER_UUID");;
ERROR HY000: The function 'group_replication_set_as_primary' failed. Error processing configuration start message: The appointed primary member has a version that is greater than the one of some of the members in the group.
include/gr_assert_spm_consistency.inc
# 7. Switch to multi-primary mode.
# Assert configurations are correct.
SELECT group_replication_switch_to_multi_primary_mode();
group_replication_switch_to_multi_primary_mode()
Mode switched to multi-primary successfully.
include/gr_assert_mpm_consistency.inc
# 8. Change primary to M3.
# Assert configurations are correct.
SELECT group_replication_switch_to_single_primary_mode("MEMBER_UUID");;
group_replication_switch_to_single_primary_mode("MEMBER_UUID")
Mode switched to single-primary successfully.
include/gr_assert_spm_consistency.inc
# 9. Change primary, UDF succedds if new primary has lowest version.
# Assert configurations are correct.
SELECT group_replication_set_as_primary("MEMBER_UUID");;
group_replication_set_as_primary("MEMBER_UUID")
Primary server switched to: MEMBER_UUID
include/gr_assert_spm_consistency.inc
# 10. Make M3 weight higher and switch to SPM mode. M3 becomes primary.
# Member weight is considered among lowest equal versions.
# Assert configurations are correct.
SELECT group_replication_switch_to_multi_primary_mode();
group_replication_switch_to_multi_primary_mode()
Mode switched to multi-primary successfully.
[connection server3]
SET GLOBAL group_replication_member_weight= 60;
SELECT group_replication_switch_to_single_primary_mode();
group_replication_switch_to_single_primary_mode()
Mode switched to single-primary successfully.
include/gr_assert_spm_consistency.inc
# 11. Cleanup.
SET @@GLOBAL.group_replication_member_weight = @member_weight3_save;
[connection server2]
SELECT group_replication_switch_to_multi_primary_mode();
group_replication_switch_to_multi_primary_mode()
Mode switched to multi-primary successfully.
include/stop_group_replication.inc
SET @@GLOBAL.group_replication_member_weight = @member_weight2_save;
SET @@GLOBAL.DEBUG= @debug2_save;
include/start_group_replication.inc
include/group_replication_end.inc
|