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
|
################################################################################
# Verify that multiple groups are possible with same group name.
#
# Test:
# 0. The test requires three servers.
# 1. Bootstrap start GR on three servers.
# 2. Verify that three groups with one member on each group with same group name
# are formed.
# 3. Upon restarting GR without bootstrap on server2 and server3. Only one group
# with three members will be formed.
################################################################################
--source include/big_test.inc
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--let $rpl_server_count= 3
--source include/group_replication.inc
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
# Bootstrap start GR on server1.
--source include/start_and_bootstrap_group_replication.inc
--let $group_name_server1 = `SELECT @@GLOBAL.group_replication_group_name`
--echo #
--echo # Check that group with one member is formed.
SELECT CHANNEL_NAME, MEMBER_STATE, COUNT(*) AS COUNT from performance_schema.replication_group_members GROUP BY CHANNEL_NAME, MEMBER_STATE;
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
# Start GR on server2.
--source include/start_group_replication.inc
--echo #
--echo # Check that group now have two members.
SELECT CHANNEL_NAME, MEMBER_STATE, COUNT(*) AS COUNT from performance_schema.replication_group_members GROUP BY CHANNEL_NAME, MEMBER_STATE;
# Stop GR on server2.
--source include/stop_group_replication.inc
# To reset the GTID_EXECUTED.
RESET MASTER;
# Bootstrap start GR on server2.
--source include/start_and_bootstrap_group_replication.inc
--let $group_name_server2 = `SELECT @@GLOBAL.group_replication_group_name`
--echo #
--echo # Check that group with one member is formed.
SELECT CHANNEL_NAME, MEMBER_STATE, COUNT(*) AS COUNT from performance_schema.replication_group_members GROUP BY CHANNEL_NAME, MEMBER_STATE;
--let $rpl_connection_name= server3
--source include/rpl_connection.inc
# Bootstrap start GR on server3.
--source include/start_and_bootstrap_group_replication.inc
--let $group_name_server3 = `SELECT @@GLOBAL.group_replication_group_name`
--echo #
--echo # Check that group with one member is formed.
SELECT CHANNEL_NAME, MEMBER_STATE, COUNT(*) AS COUNT from performance_schema.replication_group_members GROUP BY CHANNEL_NAME, MEMBER_STATE;
--echo #
--echo # Verify that group name is same on all the three servers.
--let $assert_text= Verify same group name on server1 and server2
--let $assert_cond= "$group_name_server1" = "$group_name_server2"
--source include/assert.inc
--let $assert_text= Verify same group name on server1 and server3
--let $assert_cond= "$group_name_server1" = "$group_name_server3"
--source include/assert.inc
# Stop GR on server3.
--source include/stop_group_replication.inc
--echo #
--echo # Restart GR (not bootstrap) on server2 and server3.
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--source include/stop_group_replication.inc
--source include/start_group_replication.inc
--let $rpl_connection_name= server3
--source include/rpl_connection.inc
--source include/start_group_replication.inc
--echo #
--echo # Check that group with three members is formed.
SELECT CHANNEL_NAME, MEMBER_STATE, COUNT(*) AS COUNT from performance_schema.replication_group_members GROUP BY CHANNEL_NAME, MEMBER_STATE;
--source include/group_replication_end.inc
|