← Back
Editing: gr_exit_state_action_on_applier_error.result
######################################################################### # 0) Setup group of 2 members (M1 and M2). ######################################################################### include/group_replication.inc Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection server1] SET SESSION sql_log_bin = 0; call mtr.add_suppression("Slave SQL for channel 'group_replication_applier': Could not execute Write_rows event on table test.t1; Duplicate entry.*"); call mtr.add_suppression("Slave SQL for channel 'group_replication_applier': Worker [0-9] failed executing transaction*"); call mtr.add_suppression("Slave SQL for channel 'group_replication_applier': ... The slave coordinator and worker threads are stopped,*"); call mtr.add_suppression("The applier thread execution was aborted. Unable to process more transactions, this member will now leave the group."); call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group."); call mtr.add_suppression("The server was automatically set into read only mode after an error was detected."); call mtr.add_suppression("Member was expelled from the group due to network failures, changing member status to ERROR."); call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going."); call mtr.add_suppression("Fatal error during execution of Group Replication"); SET SESSION sql_log_bin = 1; ######################################################################### # 1) Force applier error on member 1. ######################################################################### [connection server1] CREATE TABLE t1(a INT PRIMARY KEY); include/rpl_sync.inc SET SESSION sql_log_bin= 0; INSERT INTO t1 VALUES (1); SET SESSION sql_log_bin= 1; [connection server2] INSERT INTO t1 VALUES (1); include/rpl_sync.inc ######################################################################### # 1.1) Verify that member 1 went to super_read_only mode. ######################################################################### [connection server1] include/gr_wait_for_member_state.inc [connection server1] include/assert.inc [super_read_only should be enabled] ######################################################################### # 2) Set exit state action to ABORT_SERVER on member 1. ######################################################################### include/stop_group_replication.inc SET sql_log_bin = 0; DELETE FROM t1 WHERE a = 1; SET sql_log_bin = 1; SET @@GLOBAL.group_replication_exit_state_action = ABORT_SERVER; ######################################################################### # 3) Force applier error again on member 1. ######################################################################### include/start_group_replication.inc SET SESSION sql_log_bin= 0; INSERT INTO t1 VALUES (2); SET SESSION sql_log_bin= 1; [connection server2] INSERT INTO t1 VALUES (2); ######################################################################### # 3.1) Verify that member 1 aborted. ######################################################################### include/rpl_gr_wait_for_number_of_members.inc include/assert.inc [Member 1 should have aborted] ######################################################################### # 4) Relaunch member 1. ######################################################################### [connection server1] include/rpl_reconnect.inc [connection server1] SET SESSION sql_log_bin= 0; DELETE FROM t1 WHERE a = 2; SET SESSION sql_log_bin= 1; SET @@global.group_replication_group_seeds="GROUP_SEEDS_SERVER1"; SET @@global.group_replication_local_address="LOCAL_ADDRESS_SERVER1"; SET @@global.group_replication_ip_whitelist="GROUP_REPLICATION_GROUP_WHITELIST"; include/start_group_replication.inc include/rpl_gr_wait_for_number_of_members.inc ######################################################################### # 5) Cleanup. ######################################################################### DROP TABLE t1; include/group_replication_end.inc
Save File
Cancel