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
|
###############################################################################
# This test verifies that when no recovery channel credentials exist the
# recovery process fails in a sane way.
#
# 0. This test requires 2 servers S1,S2
# 1. Install clone plugin on server1.
# 2. Bootstrap server1 and add some data
# 3. Install the Clone plugin on server2
# 4. Remove the recovery credentials
# On a empty server2 start group replication
# Clone and distributed recovery shall fail
# 5. Cleanup
#
--source include/have_group_replication_xcom_communication_stack.inc
--source include/have_clone_plugin.inc
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc
# Validate plugins
--let plugins = CLONE_PLUGIN,GROUP_REPLICATION
--source include/check_plugin_dir.inc
--echo
--echo ############################################################
--echo # 1. Install clone plugin on server1.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--let $server1_port= `SELECT @@GLOBAL.PORT`
--replace_result $CLONE_PLUGIN CLONE_PLUGIN
--eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN'
--echo
--echo ############################################################
--echo # 2. Bootstrap server1 and add some data
--source include/start_and_bootstrap_group_replication.inc
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
--echo
--echo ############################################################
--echo # 3. Install the Clone plugin on server2
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--replace_result $CLONE_PLUGIN CLONE_PLUGIN
--eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN'
--echo
--echo ############################################################
--echo # 4. Remove the recovery credentials
--echo # On a empty server2 start group replication
--echo # Clone and distributed recovery shall fail
# Remove the recovery channel
--disable_warnings
RESET SLAVE ALL FOR CHANNEL 'group_replication_recovery';
--enable_warnings
--let $assert_text= 'The group replication recovery channel is gone'
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_status where CHANNEL_NAME="group_replication_recovery", count, 1] = 0
--source include/assert.inc
--let $_group_replication_threshold_save= `SELECT @@GLOBAL.group_replication_clone_threshold`
--let $_group_replication_retry_save= `SELECT @@GLOBAL.group_replication_recovery_retry_count`
SET GLOBAL group_replication_recovery_retry_count= 1;
SET GLOBAL group_replication_clone_threshold= 1;
--let $group_replication_start_member_state= ERROR
--source include/start_group_replication.inc
--source include/stop_group_replication.inc
--echo
--echo ############################################################
--echo # 5. Cleanup
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
DROP TABLE t1;
UNINSTALL PLUGIN clone;
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
UNINSTALL PLUGIN clone;
--eval SET GLOBAL group_replication_clone_threshold= $_group_replication_threshold_save
--eval SET GLOBAL group_replication_recovery_retry_count= $_group_replication_retry_save
set session sql_log_bin=0;
call mtr.add_suppression("This member will start distributed recovery using clone. It is due to the number of missing transactions being higher than the configured threshold of*");
call mtr.add_suppression("There was an issue when configuring the remote cloning process: Could not extract the access credentials for the clone process");
call mtr.add_suppression("Due to some issue on the previous step distributed recovery is now executing: Incremental Recovery.");
call mtr.add_suppression(".*Invalid .* username when attempting to connect to the source server.*");
call mtr.add_suppression("There was an error when connecting to the donor. Please check that group_replication_recovery channel*");
call mtr.add_suppression("For details please check performance_schema.replication_connection_status table and error log messages of*");
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("Skipping leave operation: concurrent attempt to leave the group is on-going.");
call mtr.add_suppression("Fatal error during the incremental recovery process of Group Replication. The server will leave the group.");
call mtr.add_suppression("There was an error when connecting to the donor server. Please check that group_replication_recovery channel credentials*");
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
set session sql_log_bin=1;
--source include/group_replication_end.inc
|