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
|
################################################################################
# This test verifies that recovery retries after not finding any donor
# for recovery.
#
# To test this a joiner is started with empty donor list. The donor
# list is made empty by activating recovery_thread_start_wait dbug
# point on the donor (the first joiner/bootstrapping member),
# which place both donor and joiner in recovery state.
# The test verifies that joiner retries and rebuilds donor list
# after failing in first attempt and recovers successfully after donor
# comes online.
#
# Test:
# 0. The test requires two servers: M1 and M2.
# 1. Set DEBUG on M1 to block recovery. Bootstrap start group on M1 to keep it
# in recovery state.
# 2. Start GR on M2 and verify it is in recovery state.
# 3. Awake/SIGNAL the recovery process and verify both members are ONLINE now.
# Assert check the messages in error log about joiner retries, establishing
# group recovery connection.
# 4. Clean up.
################################################################################
--source include/have_debug.inc
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc
--echo #
--echo # Start group replication on member1 and activate
--echo # recovery_thread_start_wait dbug point to keep it
--echo # in recovery state
--echo #
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET @debug_save= @@GLOBAL.DEBUG;
--echo # Set the debug flag to block recovery
SET @@GLOBAL.DEBUG='d,recovery_thread_start_wait';
SET GLOBAL group_replication_bootstrap_group= 1;
--let $group_replication_start_member_state= RECOVERING
--source include/start_group_replication.inc
SET GLOBAL group_replication_bootstrap_group= 0;
--echo #
--echo # Start group replication on member2 and verify
--echo # it is in recovery state
--echo #
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--let $recovery_reconnect_interval= `SELECT @@GLOBAL.GROUP_REPLICATION_RECOVERY_RECONNECT_INTERVAL`
SET GLOBAL group_replication_recovery_reconnect_interval= 1;
--let $group_replication_start_member_state= RECOVERING
--source include/start_group_replication.inc
#sleep to give time for the start to get stuck on recovery and retry
--sleep 5
--echo #
--echo # Awake the recovery process and verify both members
--echo # are ONLINE now
--echo #
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET DEBUG_SYNC= "now SIGNAL signal.recovery_continue";
SET @@GLOBAL.DEBUG= @debug_save;
--let $group_replication_member_state= ONLINE
--source include/gr_wait_for_member_state.inc
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--let $group_replication_member_state= ONLINE
--source include/gr_wait_for_member_state.inc
--replace_regex /[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][-+Z][0-9:]* *[0-9]* *\[/DATE_TIME [/
--let $grep_file=$MYSQLTEST_VARDIR/tmp/group_replication_recovery_donor_retry.err
--let $grep_pattern= Establishing group recovery connection with a possible donor
--source include/grep_pattern.inc
--replace_regex /[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][-+Z][0-9:]* *[0-9]* *\[/DATE_TIME [/
--let $grep_output= boolean
--let $grep_file=$MYSQLTEST_VARDIR/tmp/group_replication_recovery_donor_retry.err
--let $grep_pattern= Retrying group recovery connection with another donor
--source include/grep_pattern.inc
--replace_regex /[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][-+Z][0-9:]* *[0-9]* *\[/DATE_TIME [/
--let $grep_output= boolean
--let $grep_file=$MYSQLTEST_VARDIR/tmp/group_replication_recovery_donor_retry.err
--let $grep_pattern= No valid donors exist in the group, retrying
--source include/grep_pattern.inc
--echo #
--echo # Cleanup
--echo #
--eval SET GLOBAL group_replication_recovery_reconnect_interval= $recovery_reconnect_interval
--source include/group_replication_end.inc
|