| 1 |
################################################################################ |
| 2 |
# |
| 3 |
# Test validates that all members use same UUID on View log event configured on |
| 4 |
# group_replication_view_change_uuid. |
| 5 |
# |
| 6 |
# Test: |
| 7 |
# 0. This test requires 2 servers to create a Group Replication setup |
| 8 |
# 1. Define two uuid for use on view_change_uuid |
| 9 |
# 2. Bootstrap group with VIEW_CHANGE_UUID |
| 10 |
# 3. To change view_change_uuid group replication shall be |
| 11 |
# stopped |
| 12 |
# 4. A member only can join if it has same view_change_uuid |
| 13 |
# that is defined on group |
| 14 |
# 5. Server 2 configured with view_change_uuid of group |
| 15 |
# can join |
| 16 |
# 6. Confirm both server have same GTID.EXECUTED from all |
| 17 |
# the views logged |
| 18 |
# 7. Cleanup |
| 19 |
# |
| 20 |
################################################################################ |
| 21 |
--source include/have_group_replication_plugin.inc |
| 22 |
--let $rpl_skip_group_replication_start= 1 |
| 23 |
--source include/group_replication.inc |
| 24 |
|
| 25 |
|
| 26 |
--echo |
| 27 |
--echo ############################################################ |
| 28 |
--echo # 1. Define two uuid for use on view_change_uuid |
| 29 |
|
| 30 |
--let $view_change_uuid = aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa |
| 31 |
--let $view_change_uuid_different = aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaab |
| 32 |
|
| 33 |
--echo |
| 34 |
--echo ############################################################ |
| 35 |
--echo # 2. Bootstrap group with VIEW_CHANGE_UUID |
| 36 |
|
| 37 |
SET @group_replication_view_change_uuid_save= @@GLOBAL.group_replication_view_change_uuid; |
| 38 |
|
| 39 |
--eval SET GLOBAL group_replication_view_change_uuid = "$view_change_uuid" |
| 40 |
|
| 41 |
--source include/start_and_bootstrap_group_replication.inc |
| 42 |
|
| 43 |
--echo |
| 44 |
--echo ############################################################ |
| 45 |
--echo # 3. To change view_change_uuid group replication shall be |
| 46 |
--echo # stopped |
| 47 |
|
| 48 |
--error ER_GROUP_REPLICATION_RUNNING |
| 49 |
--eval SET GLOBAL group_replication_view_change_uuid = "$view_change_uuid_different" |
| 50 |
|
| 51 |
|
| 52 |
--echo |
| 53 |
--echo ############################################################ |
| 54 |
--echo # 4. A member only can join if it has same view_change_uuid |
| 55 |
--echo # that is defined on group |
| 56 |
|
| 57 |
--let $rpl_connection_name= server2 |
| 58 |
--source include/rpl_connection.inc |
| 59 |
|
| 60 |
SET SESSION sql_log_bin=0; |
| 61 |
call mtr.add_suppression(".*The member is configured with a group_replication_view_change_uuid option value .* different from the group .*. The member will now exit the group."); |
| 62 |
SET SESSION sql_log_bin=1; |
| 63 |
|
| 64 |
SET @group_replication_view_change_uuid_save= @@GLOBAL.group_replication_view_change_uuid; |
| 65 |
|
| 66 |
--eval SET GLOBAL group_replication_view_change_uuid = "$view_change_uuid_different" |
| 67 |
|
| 68 |
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME |
| 69 |
--eval SET GLOBAL group_replication_group_name = "$group_replication_group_name" |
| 70 |
|
| 71 |
--error ER_GROUP_REPLICATION_CONFIGURATION |
| 72 |
START GROUP_REPLICATION; |
| 73 |
|
| 74 |
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err |
| 75 |
--let $assert_select= The member is configured with a group_replication_view_change_uuid option value '.*' different from the group '.*'. The member will now exit the group. |
| 76 |
--let $assert_count= 1 |
| 77 |
--let $assert_text= group_replication_view_change_uuid from joiner different from group |
| 78 |
--source include/assert_grep.inc |
| 79 |
|
| 80 |
--echo |
| 81 |
--echo ############################################################ |
| 82 |
--echo # 5. Server 2 configured with view_change_uuid of group |
| 83 |
--echo # can join |
| 84 |
|
| 85 |
--eval SET GLOBAL group_replication_view_change_uuid = "$view_change_uuid" |
| 86 |
--source include/start_group_replication.inc |
| 87 |
|
| 88 |
--echo |
| 89 |
--echo ############################################################ |
| 90 |
--echo # 6. Confirm both server have same GTID.EXECUTED from all |
| 91 |
--echo # the views logged |
| 92 |
|
| 93 |
|
| 94 |
--let $assert_text= GTID_EXECUTED must only contain view changes |
| 95 |
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$view_change_uuid:1-3" |
| 96 |
--source include/assert.inc |
| 97 |
|
| 98 |
--let $rpl_connection_name= server1 |
| 99 |
--source include/rpl_connection.inc |
| 100 |
|
| 101 |
--let $assert_text= GTID_EXECUTED must only contain view changes |
| 102 |
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$view_change_uuid:1-3" |
| 103 |
--source include/assert.inc |
| 104 |
|
| 105 |
--echo |
| 106 |
--echo ############################################################ |
| 107 |
--echo # 7. Cleanup |
| 108 |
|
| 109 |
--source include/stop_group_replication.inc |
| 110 |
SET @@GLOBAL.group_replication_view_change_uuid= @group_replication_view_change_uuid_save; |
| 111 |
|
| 112 |
--let $rpl_connection_name= server2 |
| 113 |
--source include/rpl_connection.inc |
| 114 |
|
| 115 |
--source include/stop_group_replication.inc |
| 116 |
SET @@GLOBAL.group_replication_view_change_uuid= @group_replication_view_change_uuid_save; |
| 117 |
|
| 118 |
--source include/group_replication_end.inc |
| 119 |
|