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 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
|
################################################################################
# The test verifies the 'START GROUP_REPLICATION' behavior with different GR
# configuration variables.
#
# Test:
# 0. The test requires two servers: M1 and M2.
# 1. Try setting invalid values to group_replication_bootstrap_group variable.
# It must fail.
# 2. Try start Group Replication on M1 without configuring any communication
# engine parameter, start must fail.
# 3. Try start Group Replication on M1 with only bootstrap parameter enabled,
# start must fail.
# 4. Try start Group Replication on M1 with invalid local_address parameter set,
# start must fail.
# 5. Try start Group Replication on M1 with only local_address parameter set,
# start must fail.
# 6. Try start Group Replication on M1 with bootstrap parameter enabled and
# group_seeds, start must fail on M1.
# 7. Try start Group Replication on M1 with bootstrap parameter enabled and
# local_address, start must succeed on M1. M1 should come ONLINE.
# 8. Try start Group Replication on M2 with invalid group_seeds, start must
# fail.
# 9. Try start Group Replication on M2 with invalid group_seeds, start must
# fail.
# 10. Try start Group Replication on server2 with
# local_address and group_seeds set to NULL, start
# must fail.
# 11. Try start Group Replication on M2 with valid local_address and
# group_seeds, start must succeed. M2 should come ONLINE.
# 12. We must have a group with two members.
# 13. Clean up.
################################################################################
--source include/big_test.inc
--source include/not_have_privilege_checks_user.inc
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc
# Suppress expected errors on error log.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET SESSION sql_log_bin= 0;
call mtr.add_suppression("Unable to initialize the group communication engine");
call mtr.add_suppression("Error on group communication engine initialization");
call mtr.add_suppression("Error on group communication engine start");
call mtr.add_suppression("Invalid hostname or IP address \\(.*\\) assigned to the parameter local_node!");
call mtr.add_suppression("\\[GCS\\] Unable to join the group: peers not configured.");
call mtr.add_suppression("\\[GCS\\] Timeout while waiting for the group communication engine to exit!");
call mtr.add_suppression("\\[GCS\\] The member has failed to gracefully leave the group.");
call mtr.add_suppression("\\[GCS\\] None of the provided peer address is valid.");
call mtr.add_suppression("\\[GCS\\] read failed");
call mtr.add_suppression("\\[GCS\\] Invalid hostname or IP address.*");
call mtr.add_suppression("\\[GCS\\] The group_name, peer_nodes, local_node,");
SET SESSION sql_log_bin= 1;
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
SET SESSION sql_log_bin= 0;
call mtr.add_suppression("Unable to initialize the group communication engine");
call mtr.add_suppression("Error on group communication engine initialization");
call mtr.add_suppression("Peer address .* is not valid.");
call mtr.add_suppression("\\[GCS\\] The group_name, peer_nodes, local_node or bootstrap_group parameters were not specified.");
call mtr.add_suppression("\\[GCS\\] Timeout while waiting for the group communication engine to exit!");
call mtr.add_suppression("\\[GCS\\] The member has failed to gracefully leave the group.");
call mtr.add_suppression("\\[GCS\\] None of the provided peer address is valid.");
call mtr.add_suppression("\\[GCS\\] read failed");
call mtr.add_suppression("\\[GCS\\] The group_name, peer_nodes, local_node,");
SET SESSION sql_log_bin= 1;
# Hide generated group name from result file.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--disable_query_log
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
--enable_query_log
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--disable_query_log
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
--enable_query_log
# Save XCom configuration.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET @local_address= @@GLOBAL.group_replication_local_address;
SET @group_seeds= @@GLOBAL.group_replication_group_seeds;
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
SET @local_address= @@GLOBAL.group_replication_local_address;
SET @group_seeds= @@GLOBAL.group_replication_group_seeds;
# Clear XCom configuration on all servers.
--source include/gr_clear_configuration.inc
--replace_result $_group_replication_ip_allowlist GROUP_LOCAL_IP_ALLOWLIST
--eval SET PERSIST group_replication_ip_allowlist= "$_group_replication_ip_allowlist"
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--replace_result $_group_replication_ip_allowlist GROUP_LOCAL_IP_ALLOWLIST
--eval SET PERSIST group_replication_ip_allowlist= "$_group_replication_ip_allowlist"
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--echo #######################################################
--echo # 1. Try setting bootstrap_group variable with invalid
--echo # values. It must fail.
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL group_replication_bootstrap_group= NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL group_replication_bootstrap_group= "a";
--error ER_WRONG_TYPE_FOR_VAR
SET GLOBAL group_replication_bootstrap_group= 1.2;
--echo #######################################################
--echo # 2. Try start Group Replication without configure any
--echo # communication engine parameter, start must fail.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--error ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR
START GROUP_REPLICATION;
--let $member_state= query_get_value(SELECT Member_State from performance_schema.replication_group_members, Member_State, 1)
--let $assert_text= The value of member_state must be offline
--let $assert_cond= "$member_state" = "OFFLINE"
--source include/assert.inc
--echo #######################################################
--echo # 3. Try start Group Replication with only bootstrap
--echo # parameter enabled, start must fail.
SET GLOBAL group_replication_bootstrap_group= 1;
SET GLOBAL group_replication_local_address= "";
SET GLOBAL group_replication_group_seeds= "";
--error ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR
START GROUP_REPLICATION;
--let $member_state= query_get_value(SELECT Member_State from performance_schema.replication_group_members, Member_State, 1)
--let $assert_text= The value of member_state must be offline
--let $assert_cond= "$member_state" = "OFFLINE"
--source include/assert.inc
--echo #######################################################
--echo # 4. Try start Group Replication with invalid
--echo # local_address parameter set, start must fail.
SET GLOBAL group_replication_bootstrap_group= 0;
SET GLOBAL group_replication_local_address= "ola";
SET GLOBAL group_replication_group_seeds= "";
--error ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR
START GROUP_REPLICATION;
--let $member_state= query_get_value(SELECT Member_State from performance_schema.replication_group_members, Member_State, 1)
--let $assert_text= The value of member_state must be offline
--let $assert_cond= "$member_state" = "OFFLINE"
--source include/assert.inc
--echo #######################################################
--echo # 5. Try start Group Replication with only local_address
--echo # parameter set, start must fail.
SET GLOBAL group_replication_bootstrap_group= 0;
SET GLOBAL group_replication_local_address= @local_address;
SET GLOBAL group_replication_group_seeds= "";
--error ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR
START GROUP_REPLICATION;
--let $member_state= query_get_value(SELECT Member_State from performance_schema.replication_group_members, Member_State, 1)
--let $assert_text= The value of member_state must be offline
--let $assert_cond= "$member_state" = "OFFLINE"
--source include/assert.inc
--echo #######################################################
--echo # 6. Try start Group Replication with bootstrap
--echo # parameter enable and group_seeds, start must
--echo # fail.
SET GLOBAL group_replication_bootstrap_group= 1;
SET GLOBAL group_replication_local_address= "";
SET GLOBAL group_replication_group_seeds= @group_seeds;
--error ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR
START GROUP_REPLICATION;
--let $member_state= query_get_value(SELECT Member_State from performance_schema.replication_group_members, Member_State, 1)
--let $assert_text= The value of member_state must be offline
--let $assert_cond= "$member_state" = "OFFLINE"
--source include/assert.inc
--echo #######################################################
--echo # 7. Try start Group Replication with bootstrap
--echo # parameter enable and local_address, start must
--echo # succeed.
SET GLOBAL group_replication_bootstrap_group= 1;
SET GLOBAL group_replication_local_address= @local_address;
SET GLOBAL group_replication_group_seeds= "";
# Need to execute change master again as the clear configuration above resets
# the recovery channel created in the beginning.
--disable_warnings
CHANGE REPLICATION SOURCE TO SOURCE_USER='root', SOURCE_PASSWORD='' FOR CHANNEL 'group_replication_recovery';
--enable_warnings
--source include/start_group_replication.inc
--echo #######################################################
--echo # 8. Try start Group Replication on server2 with invalid
--echo # invalid group_seeds, start must fail.
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
SET GLOBAL group_replication_bootstrap_group= 0;
SET GLOBAL group_replication_local_address= @local_address;
SET GLOBAL group_replication_group_seeds= "ola";
--error ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR
START GROUP_REPLICATION;
--let $member_state= query_get_value(SELECT Member_State from performance_schema.replication_group_members, Member_State, 1)
--let $assert_text= The value of member_state must be offline
--let $assert_cond= "$member_state" = "OFFLINE"
--source include/assert.inc
--echo #######################################################
--echo # 9. Try start Group Replication on server2 with
--echo # invalid group_seeds, start must fail.
SET GLOBAL group_replication_bootstrap_group= 0;
SET GLOBAL group_replication_local_address= @local_address;
--let $invalid= `SELECT REPLACE(@group_seeds, ',', ';')`
--disable_query_log
--eval SET GLOBAL group_replication_group_seeds= "$invalid"
--enable_query_log
--error ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR
START GROUP_REPLICATION;
--let $member_state= query_get_value(SELECT Member_State from performance_schema.replication_group_members, Member_State, 1)
--let $assert_text= The value of member_state must be offline
--let $assert_cond= "$member_state" = "OFFLINE"
--source include/assert.inc
--echo #######################################################
--echo # 10. Try start Group Replication on server2 with
--echo # local_address and group_seeds set to NULL, start
--echo # must fail.
SET GLOBAL group_replication_bootstrap_group= 0;
SET GLOBAL group_replication_local_address= NULL;
SET GLOBAL group_replication_group_seeds= NULL;
--error ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR
START GROUP_REPLICATION;
--let $member_state= query_get_value(SELECT Member_State from performance_schema.replication_group_members, Member_State, 1)
--let $assert_text= The value of member_state must be offline
--let $assert_cond= "$member_state" = "OFFLINE"
--source include/assert.inc
--echo #######################################################
--echo # 11. Try start Group Replication on server2 with valid
--echo # local_address and some invalid group_seeds, start must
--echo # succeed.
SET GLOBAL group_replication_bootstrap_group= 0;
SET GLOBAL group_replication_local_address= @local_address;
--let $invalid_with_valid= `SELECT CONCAT(@group_seeds, ',', 'ola:1234')`
--disable_query_log
--eval SET GLOBAL group_replication_group_seeds= "$invalid_with_valid"
--enable_query_log
# Need to execute change master again as the clear configuration above resets
# the recovery channel created in the beginning.
--disable_warnings
CHANGE REPLICATION SOURCE TO SOURCE_USER='root', SOURCE_PASSWORD='' FOR CHANNEL 'group_replication_recovery';
--enable_warnings
--source include/start_group_replication.inc
--echo #######################################################
--echo # 12. We must have a group with two members.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--let $group_replication_number_of_members= 2
--source include/gr_wait_for_number_of_members.inc
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--let $group_replication_number_of_members= 2
--source include/gr_wait_for_number_of_members.inc
--echo #######################################################
--echo # 13. Cleanup.
SET GLOBAL group_replication_group_seeds= @group_seeds;
--source include/group_replication_end.inc
|