######################################################################### # 0) The test requires two servers: 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] ######################################################################### # 1) Execute a few transactions locally on M1 before starting GR. ######################################################################### CREATE TABLE t1(a INT PRIMARY KEY); INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (3); ######################################################################### # 2) Set GTID_PURGED a few transactions ahead on M1. ######################################################################### SET sql_log_bin = 0; include/gtid_utils.inc SET sql_log_bin = 1; RESET MASTER; SET GLOBAL GTID_PURGED = "7c4f89da-55d2-4a9a-8aa1-b9e854dcf286:1-3"; include/assert.inc [GTID_PURGED should contain the first 3 transactions] RESET MASTER; ######################################################################### # 3) Start GR on both members and verify that the group stabilizes # itself. ######################################################################### include/start_and_bootstrap_group_replication.inc include/rpl_sync.inc [connection server2] SET sql_log_bin = 0; include/gtid_utils.inc SET sql_log_bin = 1; include/start_group_replication.inc ######################################################################### # 4) Try to modify the GTID_PURGED with GR running. It should fail with # ER_UPDATE_GTID_PURGED_WITH_GR on each member. ######################################################################### [connection server1] SET GLOBAL GTID_PURGED = "7c4f89da-55d2-4a9a-8aa1-b9e854dcf286:4"; ERROR HY000: Cannot update GTID_PURGED with the Group Replication plugin running include/assert.inc [GTID_PURGED should contain the 4th transaction] ######################################################################### # 5) Stop GR and verify that it is possible to set GTID_PURGED again on # both members. ######################################################################### include/stop_group_replication.inc SET GLOBAL GTID_PURGED = "7c4f89da-55d2-4a9a-8aa1-b9e854dcf286:4"; include/assert.inc [GTID_PURGED should contain the 4th transaction] [connection server2] include/stop_group_replication.inc SET GLOBAL GTID_PURGED = "7c4f89da-55d2-4a9a-8aa1-b9e854dcf286:4"; SELECT @@GLOBAL.GTID_PURGED; @@GLOBAL.GTID_PURGED 7c4f89da-55d2-4a9a-8aa1-b9e854dcf286:4 include/assert.inc [GTID_PURGED should contain the 4th transaction] ######################################################################### # 6) Cleanup. ######################################################################### [connection server1] DROP TABLE t1; SET SESSION sql_log_bin= 0; include/gtid_utils_end.inc SET SESSION sql_log_bin= 1; [connection server2] SET SESSION sql_log_bin= 0; include/gtid_utils_end.inc SET SESSION sql_log_bin= 1; include/group_replication_end.inc