| 1 |
################################################################################ |
| 2 |
# Verify that group_replication_gtid_assignment_block_size |
| 3 |
# validates its input values. |
| 4 |
# |
| 5 |
# Test: |
| 6 |
# 0. The test requires two servers: M1 and M2. |
| 7 |
# 1. Set invalid values to group_replication_gtid_assignment_block_size. Expect |
| 8 |
# error ER_WRONG_TYPE_FOR_VAR. |
| 9 |
# 2. Set valid values to group_replication_gtid_assignment_block_size. Expect |
| 10 |
# SUCCESS. |
| 11 |
# 3. Bootstrap start GR on M1. Set group_replication_gtid_assignment_block_size |
| 12 |
# while Group Replication is running. It should be blocked. |
| 13 |
# 4. Set group_replication_gtid_assignment_block_size to some different value |
| 14 |
# on M2 than member M1. |
| 15 |
# - Try start GR on M2. It should FAIL. |
| 16 |
# - Verify the messages in error log. |
| 17 |
# 5. Clean up. |
| 18 |
################################################################################ |
| 19 |
--source include/have_group_replication_plugin.inc |
| 20 |
--let $rpl_skip_group_replication_start= 1 |
| 21 |
--source include/group_replication.inc |
| 22 |
|
| 23 |
--let $rpl_connection_name= server2 |
| 24 |
--source include/rpl_connection.inc |
| 25 |
SET @group_replication_gtid_assignment_block_size_save= @@GLOBAL.group_replication_gtid_assignment_block_size; |
| 26 |
|
| 27 |
--let $rpl_connection_name= server1 |
| 28 |
--source include/rpl_connection.inc |
| 29 |
SET @group_replication_gtid_assignment_block_size_save= @@GLOBAL.group_replication_gtid_assignment_block_size; |
| 30 |
|
| 31 |
|
| 32 |
--echo |
| 33 |
--echo ############################################################ |
| 34 |
--echo # 1. Set invalid values to group_replication_gtid_assignment_block_size. |
| 35 |
--error ER_WRONG_TYPE_FOR_VAR |
| 36 |
SET GLOBAL group_replication_gtid_assignment_block_size= ON; |
| 37 |
|
| 38 |
--error ER_WRONG_TYPE_FOR_VAR |
| 39 |
SET GLOBAL group_replication_gtid_assignment_block_size= OFF; |
| 40 |
|
| 41 |
--error ER_WRONG_TYPE_FOR_VAR |
| 42 |
SET GLOBAL group_replication_gtid_assignment_block_size= " "; |
| 43 |
|
| 44 |
--error ER_WRONG_TYPE_FOR_VAR |
| 45 |
SET GLOBAL group_replication_gtid_assignment_block_size= "a"; |
| 46 |
|
| 47 |
--error ER_WRONG_TYPE_FOR_VAR |
| 48 |
SET GLOBAL group_replication_gtid_assignment_block_size= 1.0; |
| 49 |
|
| 50 |
--error ER_WRONG_VALUE_FOR_VAR |
| 51 |
SET GLOBAL group_replication_gtid_assignment_block_size= 0; |
| 52 |
|
| 53 |
--error ER_WRONG_VALUE_FOR_VAR |
| 54 |
SET GLOBAL group_replication_gtid_assignment_block_size= -1; |
| 55 |
|
| 56 |
--error ER_WRONG_VALUE_FOR_VAR |
| 57 |
SET GLOBAL group_replication_gtid_assignment_block_size= 9223372036854775808; |
| 58 |
|
| 59 |
|
| 60 |
--echo |
| 61 |
--echo ############################################################ |
| 62 |
--echo # 2. Set valid values to group_replication_gtid_assignment_block_size. |
| 63 |
SET GLOBAL group_replication_gtid_assignment_block_size= 1; |
| 64 |
--let $assert_text= group_replication_gtid_assignment_block_size is correct |
| 65 |
--let $assert_cond= [SELECT @@GLOBAL.group_replication_gtid_assignment_block_size] = 1 |
| 66 |
--source include/assert.inc |
| 67 |
|
| 68 |
SET GLOBAL group_replication_gtid_assignment_block_size= 65535; |
| 69 |
--let $assert_text= group_replication_gtid_assignment_block_size is correct |
| 70 |
--let $assert_cond= [SELECT @@GLOBAL.group_replication_gtid_assignment_block_size] = 65535 |
| 71 |
--source include/assert.inc |
| 72 |
|
| 73 |
SET GLOBAL group_replication_gtid_assignment_block_size= 4294967295; |
| 74 |
--let $assert_text= group_replication_gtid_assignment_block_size is correct |
| 75 |
--let $assert_cond= [SELECT @@GLOBAL.group_replication_gtid_assignment_block_size] = 4294967295 |
| 76 |
--source include/assert.inc |
| 77 |
|
| 78 |
SET GLOBAL group_replication_gtid_assignment_block_size= 9223372036854775807; |
| 79 |
--let $assert_text= group_replication_gtid_assignment_block_size is correct |
| 80 |
--let $assert_cond= [SELECT @@GLOBAL.group_replication_gtid_assignment_block_size] = 9223372036854775807 |
| 81 |
--source include/assert.inc |
| 82 |
|
| 83 |
|
| 84 |
--echo |
| 85 |
--echo ############################################################ |
| 86 |
--echo # 3. Try set group_replication_gtid_assignment_block_size |
| 87 |
--echo # while Group Replication is running. |
| 88 |
--echo # It will be disallowed. |
| 89 |
SET GLOBAL group_replication_gtid_assignment_block_size= 1; |
| 90 |
--let $assert_text= group_replication_gtid_assignment_block_size is correct |
| 91 |
--let $assert_cond= [SELECT @@GLOBAL.group_replication_gtid_assignment_block_size] = 1 |
| 92 |
--source include/assert.inc |
| 93 |
|
| 94 |
--source include/start_and_bootstrap_group_replication.inc |
| 95 |
--error ER_GROUP_REPLICATION_RUNNING |
| 96 |
SET GLOBAL group_replication_gtid_assignment_block_size= 1000; |
| 97 |
--let $assert_text= group_replication_gtid_assignment_block_size is 1 |
| 98 |
--let $assert_cond= [SELECT @@GLOBAL.group_replication_gtid_assignment_block_size] = 1 |
| 99 |
--source include/assert.inc |
| 100 |
|
| 101 |
|
| 102 |
--echo |
| 103 |
--echo ############################################################ |
| 104 |
--echo # 4. Try join a group with a different value for |
| 105 |
--echo # group_replication_gtid_assignment_block_size than the |
| 106 |
--echo # group one. It will be disallowed. |
| 107 |
--let $rpl_connection_name= server2 |
| 108 |
--source include/rpl_connection.inc |
| 109 |
--disable_query_log |
| 110 |
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name" |
| 111 |
--enable_query_log |
| 112 |
|
| 113 |
SET GLOBAL group_replication_gtid_assignment_block_size= 2; |
| 114 |
--error ER_GROUP_REPLICATION_CONFIGURATION |
| 115 |
START GROUP_REPLICATION; |
| 116 |
|
| 117 |
--replace_regex /[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][-+Z][0-9:]* *[0-9]* *\[/DATE_TIME [/ |
| 118 |
--let $grep_file=$MYSQLTEST_VARDIR/tmp/group_replication_gtid_assignment_block_size.err |
| 119 |
--let $grep_pattern=The member is configured with a group_replication_gtid_assignment_block_size option value |
| 120 |
--source include/grep_pattern.inc |
| 121 |
|
| 122 |
|
| 123 |
--echo |
| 124 |
--echo ############################################################ |
| 125 |
--echo # 5. Clean up. |
| 126 |
--let $rpl_connection_name= server1 |
| 127 |
--source include/rpl_connection.inc |
| 128 |
--source include/stop_group_replication.inc |
| 129 |
SET GLOBAL group_replication_gtid_assignment_block_size= @group_replication_gtid_assignment_block_size_save; |
| 130 |
|
| 131 |
--let $rpl_connection_name= server2 |
| 132 |
--source include/rpl_connection.inc |
| 133 |
SET GLOBAL group_replication_gtid_assignment_block_size= @group_replication_gtid_assignment_block_size_save; |
| 134 |
|
| 135 |
--source include/group_replication_end.inc |