include/group_replication.inc [rpl_server_count=4] 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] # 1. Start GR on M1(primary) and create table t1. [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 .*"); call mtr.add_suppression("Slave SQL for channel 'group_replication_applier': Worker . 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("Slave: Duplicate entry '.' for key 't1.PRIMARY' Error_code: MY-001062"); call mtr.add_suppression("The applier thread execution was aborted. .*"); call mtr.add_suppression("Error running query, slave SQL thread aborted. .*"); 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("Skipping leave operation: concurrent attempt to leave the group is on-going."); set session sql_log_bin=1; include/start_and_bootstrap_group_replication.inc CREATE TABLE test.t1 (a INT PRIMARY KEY NOT NULL); INSERT INTO test.t1 values (1); # 2. Start M2. [connection server2] include/start_group_replication.inc # 3. Create and start new channel ch3_1: M1(master), M3(slave) # and ch4_1: M1(master), M4(slave). [connection server3] set session sql_log_bin=0; call mtr.add_suppression("Error reading packet from server for channel 'ch3_1': .*"); set session sql_log_bin=1; CHANGE REPLICATION SOURCE TO SOURCE_HOST='localhost', SOURCE_USER='root', SOURCE_PORT=SERVER_1_PORT for channel 'ch3_1'; Warnings: Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. Note 1760 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. include/start_slave.inc [FOR CHANNEL 'ch3_1'] [connection server4] set session sql_log_bin=0; call mtr.add_suppression("Error reading packet from server for channel 'ch4_1': .*"); set session sql_log_bin=1; CHANGE REPLICATION SOURCE TO SOURCE_HOST='localhost', SOURCE_USER='root', SOURCE_PORT=SERVER_1_PORT for channel 'ch4_1'; Warnings: Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. Note 1760 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. include/start_slave.inc [FOR CHANNEL 'ch4_1'] # 4. Insert row on M1 and table t1 with binlog off. [connection server1] SET sql_log_bin=0; INSERT INTO test.t1 values (2); SET sql_log_bin=1; # 5. Insert same row in M2 so that M1 stops due to primary key coflict. [connection server2] SET GLOBAL super_read_only= 0; INSERT INTO test.t1 values (2); # 6. Wait for GR to ERROR out on M1. [connection server1] include/gr_wait_for_member_state.inc SET GLOBAL super_read_only= FALSE; SET sql_log_bin=0; INSERT INTO test.t1 values (3); SET sql_log_bin=1; SET GLOBAL super_read_only= TRUE; # 7. Assert channels ch3_1 and ch4_1 have errored out. # Assert binlog dump thread is not present in threads table. include/assert.inc [Thread Binlog Dump GTID is killed.] [connection server3] include/assert_grep.inc [Master connection is lost.] include/assert.inc [Slave connection is stopped.] [connection server4] include/assert_grep.inc [Master connection is lost.] include/assert.inc [Slave connection is stopped.] # 8. Restore M3 channel. [connection server3] include/stop_slave.inc [FOR CHANNEL 'ch3_1'] [connection server4] include/stop_slave.inc [FOR CHANNEL 'ch4_1'] [connection server1] SET GLOBAL super_read_only= FALSE; SET sql_log_bin=0; DELETE FROM test.t1 WHERE a=3; SET sql_log_bin=1; SET GLOBAL super_read_only= TRUE; # 9. Start GR on M1 and channel ch3_1: M1(master), M3(slave) # and ch4_1: M1(master), M4(slave). include/stop_group_replication.inc SET sql_log_bin=0; DELETE FROM test.t1 WHERE a=2; SET sql_log_bin=1; include/start_group_replication.inc SELECT group_replication_set_as_primary("SERVER1_UUID"); group_replication_set_as_primary("SERVER1_UUID") Primary server switched to: SERVER1_UUID INSERT INTO test.t1 values (3); [connection server3] include/start_slave.inc [FOR CHANNEL 'ch3_1'] [connection server4] include/start_slave.inc [FOR CHANNEL 'ch4_1'] # 10. Stop GR on M1. [connection server1] include/stop_group_replication.inc SET GLOBAL super_read_only= FALSE; SET sql_log_bin=0; INSERT INTO test.t1 values (4); SET sql_log_bin=1; SET GLOBAL super_read_only= TRUE; # 11. Assert channels ch3_1 and ch4_1 have errored out. # Assert binlog dump thread is not present in threads table. include/assert.inc [Thread Binlog Dump GTID is killed.] [connection server3] include/assert_grep.inc [Master connection is lost.] include/assert.inc [Slave connection is stopped.] [connection server4] include/assert_grep.inc [Master connection is lost.] include/assert.inc [Slave connection is stopped.] # 12. Cleanup [connection server1] SET GLOBAL super_read_only= FALSE; SET sql_log_bin=0; DELETE FROM test.t1 WHERE a=4; SET sql_log_bin=1; SET GLOBAL super_read_only= TRUE; include/start_group_replication.inc [connection server2] DROP TABLE test.t1; [connection server3] include/stop_slave.inc [FOR CHANNEL 'ch3_1'] RESET SLAVE ALL FOR CHANNEL 'ch3_1'; Warnings: Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead include/start_group_replication.inc [connection server4] include/stop_slave.inc [FOR CHANNEL 'ch4_1'] RESET SLAVE ALL FOR CHANNEL 'ch4_1'; Warnings: Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead include/start_group_replication.inc include/group_replication_end.inc