Current Path : /usr/opt/mysql57/mysql-test/suite/group_replication/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/opt/mysql57/mysql-test/suite/group_replication/t/gr_group_members_change.test |
################################################################################ # Multi master member state change test # This test serves the purpose of evaluating the state changes a member can # undergo. # # The state changes tested are: # 1) Single member group # Member 1: Offline => Online # 2) Member joining into existing group # Member 2: Offline => Recovering => Online # 3) Member leaving (after adding another member to guarantee quorum): # Member 3: Online => Offline # 4) Clean up. ################################################################################ --source include/have_debug.inc --let $group_replication_group_name= 89ab83b0-9f17-11e3-a5e2-0800200c9a66 --source ../inc/have_group_replication_plugin.inc --let $rpl_skip_group_replication_start= 1 --let $rpl_server_count= 3 --source ../inc/group_replication.inc SET @debug_save= @@GLOBAL.DEBUG; --echo # --echo # 1) Setup a new single member group --echo # --connection server1 --echo server1 --echo # Set the debug flag to block recovery SET @@GLOBAL.DEBUG='d,recovery_thread_wait_before_finish'; --echo # Member should be offline before start --let $assert_text= On the new stopped member, the status is OFFLINE --let $assert_cond= [select count(*) from performance_schema.replication_group_members WHERE member_state="OFFLINE"] = 1; --source include/assert.inc --source ../inc/start_and_bootstrap_group_replication.inc --echo # Member should be online as the member is alone and doesn't need recovery --let $group_replication_member_state= ONLINE --source ../inc/gr_wait_for_member_state.inc --echo # --echo # 2) A new member enters the existing group --echo # # Stop the applier on server 1 so view change event wont be written and recovery blocks on server 2 STOP SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier"; --connection server2 --echo server2 --echo # Member should be marked as on recovery on both members --let $group_replication_start_member_state= RECOVERING --source include/start_group_replication.inc --let $group_replication_member_id= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1) --connection server1 --echo server1 --let $group_replication_member_state= RECOVERING --source ../inc/gr_wait_for_member_state.inc #Unblock recovery START SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier"; --connection server2 --echo server2 --echo # Member should be marked as online on both members --let $group_replication_member_state= ONLINE --source ../inc/gr_wait_for_member_state.inc --connection server1 --echo server1 --let $group_replication_member_state= ONLINE --source ../inc/gr_wait_for_member_state.inc --echo # --echo # 3) A member leaves the existing group --echo # --echo # Add a new member to hold quorum --connection server3 --echo server3 --source include/start_group_replication.inc --echo # Member should be marked as online #reset the member id variable as it was pointing server 2 --let $group_replication_member_id= --let $group_replication_member_state= ONLINE --source ../inc/gr_wait_for_member_state.inc --source include/stop_group_replication.inc --echo # Member should be marked as offline after stop --let $group_replication_member_state= OFFLINE --source ../inc/gr_wait_for_member_state.inc --echo # --echo # Cleaning up --echo # --let $server_count=3 while ($server_count) { --connection server$server_count --echo server$server_count SET @@GLOBAL.DEBUG= @debug_save; --dec $server_count } --source ../inc/group_replication_end.inc