| 1 |
################################################################################ |
| 2 |
# Group Replication: cross-version policies |
| 3 |
# This test-case makes sure in multi-primary mode: |
| 4 |
# 1. Lower version servers(considering patch version) do not join group |
| 5 |
# 2. Higher version servers(considering patch version) are in read-only mode |
| 6 |
# 3. When versions are same(considering patch version) servers are writable |
| 7 |
# |
| 8 |
# Test: |
| 9 |
# 0. The test requires two servers: M1 and M2. |
| 10 |
# Bootstrap M1 and set environment on M2. |
| 11 |
# 1. Lower version do not join the group. |
| 12 |
# 1.1. Make M2 major version lower and make sure START GR fails. |
| 13 |
# 1.2. Make M2 minor version lower and make sure START GR fails. |
| 14 |
# 1.3. Make M2 patch version lower and make sure START GR succeeds |
| 15 |
# because both versions are 8.0 and >= 8.0.35. |
| 16 |
# 2. Higher version are in read-only mode. |
| 17 |
# 2.1. Make M2 major version higher and assert read-only is set. |
| 18 |
# 2.2. Make M2 minor version higher and assert read-only is set. |
| 19 |
# 2.3. Make M2 patch version higher and assert read-only is set. |
| 20 |
# 3. Make M2 version same as M1 and confirm both M1 and M2 are online. |
| 21 |
# Assert read-only is disabled on M2. |
| 22 |
# 4. Cleanup. |
| 23 |
# |
| 24 |
################################################################################ |
| 25 |
|
| 26 |
--source include/big_test.inc |
| 27 |
--source include/have_debug.inc |
| 28 |
--source include/have_group_replication_plugin.inc |
| 29 |
--let $rpl_skip_group_replication_start= 1 |
| 30 |
--source include/group_replication.inc |
| 31 |
|
| 32 |
--let $rpl_connection_name= server1 |
| 33 |
--source include/rpl_connection.inc |
| 34 |
--source include/start_and_bootstrap_group_replication.inc |
| 35 |
|
| 36 |
--let $rpl_connection_name= server2 |
| 37 |
--source include/rpl_connection.inc |
| 38 |
|
| 39 |
--let $server2_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1) |
| 40 |
SET SESSION sql_log_bin=0; |
| 41 |
call mtr.add_suppression("Member version is incompatible with the group."); |
| 42 |
call mtr.add_suppression("Member version is read compatible with the group."); |
| 43 |
SET SESSION sql_log_bin=1; |
| 44 |
|
| 45 |
SET @debug_save= @@GLOBAL.DEBUG; |
| 46 |
|
| 47 |
--echo |
| 48 |
--echo # 1. Lower version do not join the group. |
| 49 |
--echo |
| 50 |
|
| 51 |
--echo |
| 52 |
--echo # 1.1. Make M2 major version lower and make sure START GR fails. |
| 53 |
|
| 54 |
SET @@GLOBAL.DEBUG= 'd,group_replication_compatibility_lower_major_version'; |
| 55 |
|
| 56 |
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME |
| 57 |
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name" |
| 58 |
--error ER_GROUP_REPLICATION_CONFIGURATION |
| 59 |
START GROUP_REPLICATION; |
| 60 |
|
| 61 |
--let $assert_text= Assert M2 is OFFLINE. |
| 62 |
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_members WHERE member_state="OFFLINE" AND member_id="$server2_uuid"] = 1 |
| 63 |
--source include/assert.inc |
| 64 |
|
| 65 |
--echo |
| 66 |
--echo # 1.2. Make M2 minor version lower and make sure START GR fails. |
| 67 |
|
| 68 |
SET @@GLOBAL.DEBUG= 'd,group_replication_compatibility_lower_minor_version'; |
| 69 |
|
| 70 |
--error ER_GROUP_REPLICATION_CONFIGURATION |
| 71 |
START GROUP_REPLICATION; |
| 72 |
|
| 73 |
--let $assert_text= Assert M2 is OFFLINE. |
| 74 |
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_members WHERE member_state="OFFLINE" AND member_id="$server2_uuid"] = 1 |
| 75 |
--source include/assert.inc |
| 76 |
|
| 77 |
--echo |
| 78 |
--echo # 1.3. Make M2 patch version lower and make sure START GR succeeds |
| 79 |
--echo # because both versions are 8.0 and >= 8.0.35. |
| 80 |
|
| 81 |
SET @@GLOBAL.DEBUG= 'd,group_replication_compatibility_lower_patch_version'; |
| 82 |
--source include/start_group_replication.inc |
| 83 |
--source include/gr_assert_mpm_consistency.inc |
| 84 |
--source include/stop_group_replication.inc |
| 85 |
|
| 86 |
--echo |
| 87 |
--echo # 2. Higher version are in read-only mode. |
| 88 |
--echo |
| 89 |
|
| 90 |
--echo |
| 91 |
--echo # 2.1. Make M2 major version higher and assert read-only is set. |
| 92 |
|
| 93 |
SET @@GLOBAL.DEBUG= 'd,group_replication_compatibility_higher_major_version'; |
| 94 |
--source include/start_group_replication.inc |
| 95 |
|
| 96 |
--source include/gr_assert_mpm_consistency.inc |
| 97 |
|
| 98 |
|
| 99 |
--echo |
| 100 |
--echo # 2.2. Make M2 minor version higher and assert read-only is set. |
| 101 |
|
| 102 |
--let $rpl_connection_name= server2 |
| 103 |
--source include/rpl_connection.inc |
| 104 |
|
| 105 |
--source include/stop_group_replication.inc |
| 106 |
SET @@GLOBAL.DEBUG= 'd,group_replication_compatibility_higher_minor_version'; |
| 107 |
--source include/start_group_replication.inc |
| 108 |
|
| 109 |
--source include/gr_assert_mpm_consistency.inc |
| 110 |
|
| 111 |
|
| 112 |
--echo |
| 113 |
--echo # 2.3. Make M2 patch version higher and assert read-only is set. |
| 114 |
|
| 115 |
--let $rpl_connection_name= server2 |
| 116 |
--source include/rpl_connection.inc |
| 117 |
|
| 118 |
--source include/stop_group_replication.inc |
| 119 |
SET @@GLOBAL.DEBUG= 'd,group_replication_compatibility_higher_patch_version'; |
| 120 |
--source include/start_group_replication.inc |
| 121 |
|
| 122 |
--source include/gr_assert_mpm_consistency.inc |
| 123 |
|
| 124 |
|
| 125 |
--echo |
| 126 |
--echo # 3. Make M2 version same as M1 and confirm both M1 and M2 are online. |
| 127 |
--echo # Assert read-only is disabled on M2. |
| 128 |
--echo |
| 129 |
|
| 130 |
--let $rpl_connection_name= server2 |
| 131 |
--source include/rpl_connection.inc |
| 132 |
|
| 133 |
--source include/stop_group_replication.inc |
| 134 |
|
| 135 |
# Single member testing in MPM mode. |
| 136 |
--source include/gr_assert_mpm_consistency.inc |
| 137 |
|
| 138 |
SET @@GLOBAL.DEBUG= @debug_save; |
| 139 |
--source include/start_group_replication.inc |
| 140 |
|
| 141 |
--source include/gr_assert_mpm_consistency.inc |
| 142 |
|
| 143 |
|
| 144 |
--echo |
| 145 |
--echo # 4. Cleanup. |
| 146 |
--echo |
| 147 |
|
| 148 |
--source include/group_replication_end.inc |