← Back
Editing: gr_recovery_lower_max_retry_count.test
################################################################################ # This test verifies that recovery aborts successfully if # group_replication_recovery_retry_count is made smaller then connection # retry count in middle of recovery donor connection attempts. # # Test: # 0. The test requires two servers: M1 and M2. # 1. Bootstrap start a group on M1. # 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. # 3. Reset group_replication_recovery_retry_count to 2. # Signal donor connection attempt to continue. # 4. Verification. # 5. Clean up. ################################################################################ --source include/have_debug_sync.inc --source ../inc/have_group_replication_plugin.inc --let $rpl_skip_group_replication_start= 1 --source ../inc/group_replication.inc --let $error_file = $MYSQLTEST_VARDIR/tmp/gr_recovery_lower_max_retry_count.2.err --echo --echo # 1. Bootstrap start a group on M1. --echo --let $rpl_connection_name= server1 --source include/rpl_connection.inc --source ../inc/start_and_bootstrap_group_replication.inc --echo --echo # 2. Setup environment to fail donor connection and start GR on M2. --echo # Set DEBUG on M2 to block donor connection attempt when count reaches 3. --echo # Verify M2 is in recovery state. --echo --let $rpl_connection_name= server2 --source include/rpl_connection.inc 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; --disable_warnings CHANGE MASTER TO MASTER_USER="user_does_not_exist" FOR CHANNEL "group_replication_recovery"; --enable_warnings 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 recovery."); call mtr.add_suppression("Fatal error during the 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; --let $group_replication_start_member_state= RECOVERING --source include/start_group_replication.inc --echo --echo # 3. Reset group_replication_recovery_retry_count to 2. --echo # Signal donor connection attempt to continue. --echo 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"; --echo --echo # 4. Verification. --echo --let $group_replication_member_state= ERROR --source ../inc/gr_wait_for_member_state.inc --let $assert_file = $error_file --let $assert_text = 3 donor connections attempts were made. --let $assert_select = Retrying group recovery connection with another donor. Attempt 3/10 --let $assert_count = 1 --source include/assert_grep.inc --let $assert_file = $error_file --let $assert_text = Post change of group_replication_recovery_retry_count, 4th donor connection attempt was not made. --let $assert_select = Retrying group recovery connection with another donor. Attempt 4 --let $assert_count = 0 --source include/assert_grep.inc --let $assert_file = $error_file --let $assert_text = Recovery process aborted. --let $assert_select = Maximum number of retries when trying to connect to a donor reached. Aborting group replication recovery. --let $assert_count = 1 --source include/assert_grep.inc --echo --echo # 5. Clean up. --echo 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; --source ../inc/group_replication_end.inc
Save File
Cancel