← Back
Editing: gr_multiple_groups_with_same_name.test
################################################################################ # 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 ../inc/have_group_replication_plugin.inc --let $rpl_skip_group_replication_start= 1 --let $rpl_server_count= 3 --source ../inc/group_replication.inc --let $rpl_connection_name= server1 --source include/rpl_connection.inc # Bootstrap start GR on server1. --source ../inc/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 ../inc/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 ../inc/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 ../inc/group_replication_end.inc
Save File
Cancel