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
|
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. Bootstrap start a group on M1.
[connection server1]
SET sql_log_bin=0;
CREATE USER 'user_with_no_priv_s1'@'%';
GRANT GROUP_REPLICATION_STREAM ON *.* TO 'user_with_no_priv_s1'@'%';
FLUSH PRIVILEGES;
SET sql_log_bin=1;
include/start_and_bootstrap_group_replication.inc
# 2. Setup environment to fail donor connection and start GR on M2.
# Set DEBUG on M2 to block donor connection attempt when count reaches 3.
# Verify M2 is in recovery state.
[connection server2]
SET @debug_save= @@GLOBAL.DEBUG;
SET @recovery_reconnect_interval_save= @@GLOBAL.GROUP_REPLICATION_RECOVERY_RECONNECT_INTERVAL;
SET @recovery_retry_count_save= @@GLOBAL.group_replication_recovery_retry_count;
SET sql_log_bin=0;
CREATE USER 'user_with_no_priv_s1'@'%';
GRANT GROUP_REPLICATION_STREAM ON *.* TO 'user_with_no_priv_s1'@'%';
FLUSH PRIVILEGES;
SET sql_log_bin=1;
CHANGE REPLICATION SOURCE TO SOURCE_USER="user_with_no_priv_s1" FOR CHANNEL "group_replication_recovery";
SET SESSION sql_log_bin = 0;
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("Fatal error during the incremental recovery process of Group Replication. The server will leave the group.");
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
SET SESSION sql_log_bin = 1;
SET @@GLOBAL.DEBUG='+d,gr_reset_max_connection_attempts_to_donors';
SET GLOBAL group_replication_recovery_reconnect_interval= 2;
include/start_group_replication.inc
# 3. Reset group_replication_recovery_retry_count to 2.
# Signal donor connection attempt to continue.
SET DEBUG_SYNC= "now WAIT_FOR signal.connection_attempt_3";
SET GLOBAL group_replication_recovery_retry_count= 2;
SET DEBUG_SYNC= "now SIGNAL signal.reset_recovery_retry_count_done";
# 4. Verification.
include/gr_wait_for_member_state.inc
include/assert_grep.inc [3 donor connections attempts were made.]
include/assert_grep.inc [Post change of group_replication_recovery_retry_count, 4th donor connection attempt was not made.]
include/assert_grep.inc [Recovery process aborted.]
# 5. Clean up.
SET @@GLOBAL.DEBUG= @debug_save;
SET @@GLOBAL.GROUP_REPLICATION_RECOVERY_RECONNECT_INTERVAL= @recovery_reconnect_interval_save;
SET @@GLOBAL.group_replication_recovery_retry_count= @recovery_retry_count_save;
SET sql_log_bin=0;
SET GLOBAL super_read_only = 0;
DROP USER user_with_no_priv_s1;
SET sql_log_bin=1;
SET sql_log_bin=0;
SET GLOBAL super_read_only = 0;
DROP USER user_with_no_priv_s1;
SET sql_log_bin=1;
include/group_replication_end.inc
|