| 1 |
############################################################################### |
| 2 |
# This test verifies that when no recovery channel credentials exist the |
| 3 |
# recovery process fails in a sane way. |
| 4 |
# |
| 5 |
# 0. This test requires 2 servers S1,S2 |
| 6 |
# 1. Install clone plugin on server1. |
| 7 |
# 2. Bootstrap server1 and add some data |
| 8 |
# 3. Install the Clone plugin on server2 |
| 9 |
# 4. Remove the recovery credentials |
| 10 |
# On a empty server2 start group replication |
| 11 |
# Clone and distributed recovery shall fail |
| 12 |
# 5. Cleanup |
| 13 |
# |
| 14 |
|
| 15 |
--source include/have_group_replication_xcom_communication_stack.inc |
| 16 |
--source include/have_clone_plugin.inc |
| 17 |
--source include/have_group_replication_plugin.inc |
| 18 |
--let $rpl_skip_group_replication_start= 1 |
| 19 |
--source include/group_replication.inc |
| 20 |
|
| 21 |
# Validate plugins |
| 22 |
--let plugins = CLONE_PLUGIN,GROUP_REPLICATION |
| 23 |
--source include/check_plugin_dir.inc |
| 24 |
|
| 25 |
--echo |
| 26 |
--echo ############################################################ |
| 27 |
--echo # 1. Install clone plugin on server1. |
| 28 |
|
| 29 |
--let $rpl_connection_name= server1 |
| 30 |
--source include/rpl_connection.inc |
| 31 |
--let $server1_port= `SELECT @@GLOBAL.PORT` |
| 32 |
|
| 33 |
--replace_result $CLONE_PLUGIN CLONE_PLUGIN |
| 34 |
--eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN' |
| 35 |
|
| 36 |
--echo |
| 37 |
--echo ############################################################ |
| 38 |
--echo # 2. Bootstrap server1 and add some data |
| 39 |
|
| 40 |
--source include/start_and_bootstrap_group_replication.inc |
| 41 |
|
| 42 |
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; |
| 43 |
INSERT INTO t1 VALUES (1); |
| 44 |
INSERT INTO t1 VALUES (2); |
| 45 |
|
| 46 |
--echo |
| 47 |
--echo ############################################################ |
| 48 |
--echo # 3. Install the Clone plugin on server2 |
| 49 |
|
| 50 |
--let $rpl_connection_name= server2 |
| 51 |
--source include/rpl_connection.inc |
| 52 |
|
| 53 |
--replace_result $CLONE_PLUGIN CLONE_PLUGIN |
| 54 |
--eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN' |
| 55 |
|
| 56 |
--echo |
| 57 |
--echo ############################################################ |
| 58 |
--echo # 4. Remove the recovery credentials |
| 59 |
--echo # On a empty server2 start group replication |
| 60 |
--echo # Clone and distributed recovery shall fail |
| 61 |
|
| 62 |
# Remove the recovery channel |
| 63 |
--disable_warnings |
| 64 |
RESET SLAVE ALL FOR CHANNEL 'group_replication_recovery'; |
| 65 |
--enable_warnings |
| 66 |
|
| 67 |
--let $assert_text= 'The group replication recovery channel is gone' |
| 68 |
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_status where CHANNEL_NAME="group_replication_recovery", count, 1] = 0 |
| 69 |
--source include/assert.inc |
| 70 |
|
| 71 |
--let $_group_replication_threshold_save= `SELECT @@GLOBAL.group_replication_clone_threshold` |
| 72 |
--let $_group_replication_retry_save= `SELECT @@GLOBAL.group_replication_recovery_retry_count` |
| 73 |
|
| 74 |
SET GLOBAL group_replication_recovery_retry_count= 1; |
| 75 |
SET GLOBAL group_replication_clone_threshold= 1; |
| 76 |
|
| 77 |
--let $group_replication_start_member_state= ERROR |
| 78 |
--source include/start_group_replication.inc |
| 79 |
|
| 80 |
--source include/stop_group_replication.inc |
| 81 |
|
| 82 |
--echo |
| 83 |
--echo ############################################################ |
| 84 |
--echo # 5. Cleanup |
| 85 |
|
| 86 |
--let $rpl_connection_name= server1 |
| 87 |
--source include/rpl_connection.inc |
| 88 |
|
| 89 |
DROP TABLE t1; |
| 90 |
|
| 91 |
UNINSTALL PLUGIN clone; |
| 92 |
|
| 93 |
--let $rpl_connection_name= server2 |
| 94 |
--source include/rpl_connection.inc |
| 95 |
|
| 96 |
UNINSTALL PLUGIN clone; |
| 97 |
|
| 98 |
--eval SET GLOBAL group_replication_clone_threshold= $_group_replication_threshold_save |
| 99 |
--eval SET GLOBAL group_replication_recovery_retry_count= $_group_replication_retry_save |
| 100 |
|
| 101 |
set session sql_log_bin=0; |
| 102 |
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*"); |
| 103 |
call mtr.add_suppression("There was an issue when configuring the remote cloning process: Could not extract the access credentials for the clone process"); |
| 104 |
call mtr.add_suppression("Due to some issue on the previous step distributed recovery is now executing: Incremental Recovery."); |
| 105 |
call mtr.add_suppression(".*Invalid .* username when attempting to connect to the source server.*"); |
| 106 |
call mtr.add_suppression("There was an error when connecting to the donor. Please check that group_replication_recovery channel*"); |
| 107 |
call mtr.add_suppression("For details please check performance_schema.replication_connection_status table and error log messages of*"); |
| 108 |
call mtr.add_suppression("Maximum number of retries when trying to connect to a donor reached. Aborting group replication incremental recovery."); |
| 109 |
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going."); |
| 110 |
call mtr.add_suppression("Fatal error during the incremental recovery process of Group Replication. The server will leave the group."); |
| 111 |
call mtr.add_suppression("There was an error when connecting to the donor server. Please check that group_replication_recovery channel credentials*"); |
| 112 |
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected."); |
| 113 |
set session sql_log_bin=1; |
| 114 |
|
| 115 |
--source include/group_replication_end.inc |