1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
############################################################
# 1. Create a group with 1 member and schedule a periodic
# event to create some load in the group.
include/group_replication.inc [rpl_server_count=3]
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
[connection server1]
[connection server1]
SET SESSION sql_log_bin= 0;
call mtr.add_suppression("On shutdown there was a timeout on the Group Replication recovery module termination. Check the log for more details");
call mtr.add_suppression("Fatal error during the incremental recovery process of Group Replication. The server will 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("Error leaving the group");
call mtr.add_suppression("All donors left. Aborting group replication incremental recovery.");
call mtr.add_suppression("This member has more executed transactions *.*");
call mtr.add_suppression("The member contains transactions not present in the group. It is only allowed to *.*");
call mtr.add_suppression("The member is already leaving or joining a group.");
call mtr.add_suppression("Skipping leave operation: member already left the group.");
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
call mtr.add_suppression("Maximum number of retries when trying to connect to a donor reached. Aborting group replication incremental recovery.");
call mtr.add_suppression("Transaction cannot be executed while Group Replication is stopping.");
call mtr.add_suppression("Run function 'before_commit' in plugin 'group_replication' failed");
call mtr.add_suppression("While leaving the group due to a stop, shutdown or failure there was a timeout receiving a view change. This can lead to a possible inconsistent state. Check the log for more details");
call mtr.add_suppression("On shutdown there was a timeout on the Group Replication applier termination.");
SET SESSION sql_log_bin= 1;
CREATE TABLE t1 (a INT PRIMARY KEY AUTO_INCREMENT NOT NULL);
SET @old_event_scheduler= @@global.event_scheduler;
SET GLOBAL EVENT_SCHEDULER= ON;
CREATE EVENT IF NOT EXISTS e1
ON SCHEDULE
EVERY 1 SECOND
STARTS CURRENT_TIMESTAMP + INTERVAL 1 SECOND
ENDS CURRENT_TIMESTAMP + INTERVAL 40 SECOND
ON COMPLETION PRESERVE
ENABLE
COMMENT 'Test with events'
DO
BEGIN
DECLARE v INTEGER;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET v=0;
WHILE v < 10
DO
INSERT INTO test.t1 values (NULL);
SET v = v+1;
END WHILE;
END//
############################################################
# 2. Add error suppressions.
[connection server1]
SET SESSION sql_log_bin = 0;
call mtr.add_suppression("Replica SQL for channel 'group_replication_applier': Relay log read failure: Could not parse relay log event entry.*");
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("Skipping leave operation: concurrent attempt to leave the group is on-going.");
SET SESSION sql_log_bin = 1;
[connection server2]
SET SESSION sql_log_bin= 0;
call mtr.add_suppression("On shutdown there was a timeout on the Group Replication recovery module termination. Check the log for more details");
call mtr.add_suppression("Replica SQL for channel 'group_replication_recovery': Could not execute Write_rows event on table test.t1; Duplicate entry.*");
call mtr.add_suppression("Fatal error during the incremental recovery process of Group Replication. The server will 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("Error leaving the group");
call mtr.add_suppression("All donors left. Aborting group replication incremental recovery.");
call mtr.add_suppression("The member is already leaving or joining a group.");
call mtr.add_suppression("Skipping leave operation: member already left the group.");
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
SET SESSION sql_log_bin= 1;
[connection server3]
SET SESSION sql_log_bin= 0;
call mtr.add_suppression("On shutdown there was a timeout on the Group Replication recovery module termination. Check the log for more details");
call mtr.add_suppression("Replica SQL for channel 'group_replication_recovery': Could not execute Write_rows event on table test.t1; Duplicate entry.*");
call mtr.add_suppression("Fatal error during the incremental recovery process of Group Replication. The server will 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("Error leaving the group");
call mtr.add_suppression("All donors left. Aborting group replication incremental recovery.");
call mtr.add_suppression("The member is already leaving or joining a group.");
call mtr.add_suppression("Skipping leave operation: member already left the group.");
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
SET SESSION sql_log_bin= 1;
############################################################
# 3. Block applier channel on member 1 so that joinining
# members that will recover from it will be blocked on
# recovery waiting for the View_change_log_event on which
# them joined.
[connection server1]
SET @@GLOBAL.DEBUG='+d,block_applier_updates';
############################################################
# 4. Stop and start members 2 and 3 without waiting for
# member status.
[connection server2]
STOP GROUP_REPLICATION;
[connection server3]
STOP GROUP_REPLICATION;
[connection server2]
START GROUP_REPLICATION;
[connection server3]
START GROUP_REPLICATION;
[connection server2]
include/gr_wait_for_member_state.inc
[connection server3]
include/gr_wait_for_member_state.inc
############################################################
# 5. Stop and start member 1.
[connection server1]
SET @group_replication_recovery_reconnect_interval_save= @@GLOBAL.group_replication_recovery_reconnect_interval;
SET GLOBAL group_replication_recovery_reconnect_interval= 1;
SET @group_replication_components_stop_timeout_save = @@GLOBAL.group_replication_components_stop_timeout;
SET GLOBAL group_replication_components_stop_timeout= 2;
SET DEBUG_SYNC = "now WAIT_FOR applier_read_blocked";
SET @@GLOBAL.DEBUG='-d,block_applier_updates';
SET @@GLOBAL.DEBUG='+d,force_sql_thread_error';
SET DEBUG_SYNC = "now SIGNAL resume_applier_read";
include/gr_wait_for_member_state.inc
SET @@GLOBAL.DEBUG='-d,force_sql_thread_error';
SET DEBUG_SYNC= 'RESET';
STOP GROUP_REPLICATION;
include/assert_and_disable_read_only.inc
ALTER EVENT e1 DISABLE;
SET GLOBAL EVENT_SCHEDULER= @old_event_scheduler;
DROP EVENT e1;
DROP TABLE t1;
RESET MASTER;
START GROUP_REPLICATION;
include/gr_wait_for_member_state.inc
############################################################
# 6. Clean up.
[connection server1]
include/stop_group_replication.inc
SET GLOBAL group_replication_recovery_reconnect_interval= @group_replication_recovery_reconnect_interval_save;
SET GLOBAl group_replication_components_stop_timeout = @group_replication_components_stop_timeout_save;
[connection server2]
include/stop_group_replication.inc
DROP EVENT IF EXISTS e1;
DROP TABLE IF EXISTS t1;
[connection server3]
include/stop_group_replication.inc
DROP EVENT IF EXISTS e1;
DROP TABLE IF EXISTS t1;
include/group_replication_end.inc
|