############################################################################### # # When the plugin is stopped or leaves in error, while changing # from single primary mode to multi primary mode, if the member did # already set the single primary mode flag to false, then update # everywhere checks shall be true afer stop. # # When the plugin is stopped or leaves in error, plugin configurations # when the configuration change terminates must be valid, # even if not persisted with SET PERSIST. # # Test: # 0. This test requires three servers # 1. Server1 start and bootstrap the group # 2. Start server2 # 3. Start server3 and disable applier # 4. Execute action to switch to multi primary # 5. Server3 will leave group # 6. Server3 changed to ERROR state # 7. Check that Single primary mode is false on the stuck member and the # update everywhere checks are true # 8. Reap action executed # 9. Cleanup # ############################################################################### --source include/big_test.inc --source include/have_group_replication_plugin.inc --let $rpl_server_count= 3 --let $rpl_skip_group_replication_start= 1 --let $rpl_group_replication_single_primary_mode=1 --source include/group_replication.inc --echo --echo # 1. Server1 start and bootstrap the group --source include/start_and_bootstrap_group_replication.inc --echo --echo # 2. Start server2 --let $rpl_connection_name= server2 --source include/rpl_connection.inc --source include/start_group_replication.inc --echo --echo # 3. Start server3 and disable applier --let $rpl_connection_name= server3 --source include/rpl_connection.inc set session sql_log_bin=0; call mtr.add_suppression("A configuration change was killed in this member. The member will now leave the group as its configuration may have diverged."); call mtr.add_suppression("The server was automatically set into read only mode after an error was detected."); call mtr.add_suppression("Error while executing a group configuration operation: This operation ended in error as it was not possible to wait for the execution of the plugin queued transactions. The member will now leave the group."); call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going."); set session sql_log_bin=1; --source include/start_group_replication.inc --source include/gr_stop_applier_sql_thread.inc --echo --echo # 4. Execute action to switch to multi primary --let $rpl_connection_name= server1 --source include/rpl_connection.inc --send SELECT group_replication_switch_to_multi_primary_mode() --echo --echo # 5. Server3 will leave group --let $rpl_connection_name= server2 --source include/rpl_connection.inc --let $group_replication_number_of_members= 2 --source include/gr_wait_for_number_of_members.inc --echo --echo # 6. Server3 changed to ERROR state --let $rpl_connection_name= server3 --source include/rpl_connection.inc --let $group_replication_member_state= ERROR --source include/gr_wait_for_member_state.inc --echo --echo # 7. Check that Single primary mode is false on the stuck member and the --echo # update everywhere checks are true --let $assert_text= group_replication_enforce_update_everywhere_checks is ON --let $assert_cond= "[SELECT @@GLOBAL.group_replication_enforce_update_everywhere_checks]" = "1" --source include/assert.inc --let $assert_text= The single primary mode should be 0 here. --let $assert_cond= "[SELECT @@GLOBAL.group_replication_single_primary_mode]" = 0; --source include/assert.inc --echo --echo # 8. Reap action executed --let $rpl_connection_name= server1 --source include/rpl_connection.inc --reap --echo --echo # 9. Cleanup --let $rpl_connection_name= server3 --source include/rpl_connection.inc --source include/stop_group_replication.inc --let $group_replication_member_state= OFFLINE --source include/gr_wait_for_member_state.inc --source include/start_group_replication.inc --let $rpl_group_replication_reset_persistent_vars=1 --let $rpl_group_replication_single_primary_mode=1 --source include/group_replication_end.inc