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
|
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 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]
# 1. Start group in single primary mode.
# Server1 will be primary and server 2 secondary.
set session sql_log_bin=0;
call mtr.add_suppression("The function 'group_replication_set_as_primary' failed. The appointed primary for election left the group, this operation will be aborted and if present the old primary member will be re-elected. Check the group member list to see who is the primary.");
set session sql_log_bin=1;
SET @debug_save_m1= @@GLOBAL.DEBUG;
include/start_and_bootstrap_group_replication.inc
[connection server2]
set session sql_log_bin=0;
call mtr.add_suppression("There was an issue on the primary election process: Could not wait for the execution of local transactions. The member will now leave the group.");
call mtr.add_suppression("Plugin group_replication reported: '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("Skipping leave operation: concurrent attempt to leave the group is on-going.");
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: A critical error occurred during the local execution of this action. The member will now leave the group.");
set session sql_log_bin=1;
include/start_group_replication.inc
# 2. Fake a stopped applier on server2.
[connection server2]
SET @@GLOBAL.DEBUG= '+d,group_replication_wait_for_gtid_execution_force_error';
# 3. Start a primary change on server1 and block the operation at validation.
[connection server1]
SET @@GLOBAL.DEBUG= '+d,group_replication_block_primary_action_validation';
SELECT group_replication_set_as_primary("MEMBER2_UUID",30);
# 4. Wait for the THD_transaction_monitor thread to start and unblock the operation.
[connection server_1]
SET DEBUG_SYNC = "now SIGNAL signal.primary_action_continue";
SET @@GLOBAL.DEBUG= '-d,group_replication_block_primary_action_validation';
# 5. Allow the primary change operation to continue.
[connection server1]
ERROR HY000: The function 'group_replication_set_as_primary' failed. The appointed primary for election left the group, this operation will be aborted and if present the old primary member will be re-elected. Check the group member list to see who is the primary.
# 6. Check the monitor thread exited.
[connection server1]
include/gr_assert_primary_member.inc
[connection server2]
include/gr_wait_for_member_state.inc
SET @@GLOBAL.DEBUG= '-d,group_replication_wait_for_gtid_execution_force_error';
# 7. Cleanup
[connection server1]
SET GLOBAL DEBUG= @debug_save_m1;
[connection server2]
include/group_replication_end.inc
|