Debian Codegraph @

mysql-test/suite/group_replication/t/gr_recovery_endpoints_invalid_donor.test

raw
1 ###############################################################################
2 # Received a donor endpoints corrupted and fail recovery.
3 #
4 # Test:
5 # 0. The test requires two servers
6 # 1. Install clone plugin on server1.
7 # 2. Start server 1 and bootstrap group
8 # 3. Create some transactions to send to joiner
9 # 4. Change settings on recovery to speed up failure
10 # 5. Setup the server so group replication starts on boot
11 # Install the Clone plugin
12 # 6. Ensure clone is used on recovery
13 # 7. Activate debug point that will simulate invalid recovery endpoints
14 # from donor
15 # 8. Recovery will fail and server state change to ERROR
16 # 9. Clone and incremental distributed recovery will fail connecting to donor
17 # 10. Disable debug point ans server will be able to join
18 # 11. Stop server 2 and start it again, the information received
19 # from donor will be valid
20 # 12. Clean debug point to allow to recovery be successful
21 # 13. Cleanup
22 #
23 ###############################################################################
24
25 --source include/have_debug.inc
26 --source include/have_mysqld_monitoring_process.inc
27 --source include/have_clone_plugin.inc
28 --source include/have_group_replication_plugin.inc
29 --let $rpl_skip_group_replication_start= 1
30 --source include/group_replication.inc
31
32 --echo
33 --echo # 1. Install clone plugin on server1.
34
35 --let $rpl_connection_name= server1
36 --source include/rpl_connection.inc
37
38 --replace_result $CLONE_PLUGIN CLONE_PLUGIN
39 --eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN'
40
41 --echo
42 --echo # 2. Start server 1 and bootstrap group
43
44 --source include/start_and_bootstrap_group_replication.inc
45
46 --echo
47 --echo # 3. Create some transactions to send to joiner
48
49 CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY , b INT);
50
51 INSERT INTO test.t1 (b) VALUES (1);
52 INSERT INTO test.t1 (b) VALUES (2);
53
54 --echo
55 --echo # 4. Change settings on recovery to speed up failure
56
57 --let $rpl_connection_name = server2
58 --source include/rpl_connection.inc
59
60 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
61 --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
62 --let $_group_replication_start_on_boot= `SELECT @@GLOBAL.group_replication_start_on_boot`
63 --let $_group_replication_comm_stack= `SELECT @@GLOBAL.group_replication_communication_stack`
64
65 --let $plugin_list= $GROUP_REPLICATION
66 --source include/spawn_monitoring_process.inc
67
68 SET GLOBAL group_replication_recovery_reconnect_interval= 1;
69 SET GLOBAL group_replication_recovery_retry_count= 1;
70
71 --echo
72 --echo # 5. Setup the server so group replication starts on boot
73 --echo # Install the Clone plugin
74
75 --disable_query_log
76 --eval SET PERSIST group_replication_group_name= "$group_replication_group_name"
77 --eval SET PERSIST group_replication_local_address= "$_group_replication_local_address"
78 --eval SET PERSIST group_replication_group_seeds= "$_group_replication_group_seeds"
79 --eval SET PERSIST group_replication_communication_stack= "$_group_replication_comm_stack"
80
81 SET PERSIST group_replication_start_on_boot= ON;
82 --enable_query_log
83
84 --replace_result $CLONE_PLUGIN CLONE_PLUGIN
85 --eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN'
86
87 --echo
88 --echo # 6. Ensure clone is used on recovery
89
90 --let $_group_replication_threshold_save= `SELECT @@GLOBAL.group_replication_clone_threshold`
91 SET GLOBAL group_replication_clone_threshold= 1;
92
93 --echo
94 --echo # 7. Activate debug point that will simulate invalid recovery endpoints
95 --echo # from donor
96
97 SET @debug_save= @@GLOBAL.DEBUG;
98 SET @@GLOBAL.DEBUG='+d,gr_recovery_endpoints_invalid_donor';
99
100 --echo
101 --echo # 8. Recovery will fail and server state change to ERROR
102
103 --let $group_replication_start_member_state= ERROR
104 --source include/start_group_replication.inc
105
106 --echo
107 --echo # 9. Clone and incremental distributed recovery will fail connecting to donor
108
109 --let $assert_only_after = CURRENT_TEST: group_replication.gr_recovery_endpoints_invalid_donor
110 --let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err
111 --let $assert_count = 2
112 --let $assert_select = Received invalid recovery endpoints configuration from donor. This member is not a valid donor for recovery, so it will be skipped.
113 --let $assert_text = recovery channel received an invalid recovery endpoints configuration from donor
114 --source include/assert_grep.inc
115
116 --echo
117 --echo # 10. Disable debug point ans server will be able to join
118
119 SET @@GLOBAL.DEBUG= @debug_save;
120
121 --echo
122 --echo # 11. Stop server 2 and start it again, the information received
123 --echo # from donor will be valid
124
125 --let $rpl_connection_name = server2
126 --source include/rpl_connection.inc
127
128 --source include/stop_group_replication.inc
129
130 --echo
131 --echo # 12. Clean debug point to allow to recovery be successful
132
133
134 START GROUP_REPLICATION;
135
136 --source include/wait_until_disconnected.inc
137
138 --let $rpl_server_number= 2
139 --source include/rpl_reconnect.inc
140
141 --let $group_replication_member_state=ONLINE
142 --source include/gr_wait_for_member_state.inc
143
144 --echo
145 --echo # 13. Cleanup
146
147 DROP TABLE test.t1;
148
149 --source include/rpl_sync.inc
150
151 set session sql_log_bin=0;
152 call mtr.add_suppression("Maximum number of retries when*");
153 call mtr.add_suppression("Fatal error during the incremental recovery process of Group Replication.*");
154 call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
155 call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
156 call mtr.add_suppression("Due to the number of missing transactions being higher than the configured threshold of*");
157 call mtr.add_suppression("Clone removing all user data for provisioning: Started");
158 call mtr.add_suppression("Clone removing all user data for provisioning: Finished");
159 call mtr.add_suppression("Due to some issue on the previous step distributed recovery is now executing: Incremental Recovery.");
160 call mtr.add_suppression("Failed to shutdown components infrastructure.");
161 call mtr.add_suppression("Received invalid recovery endpoints configuration from donor. This member is not a valid donor for recovery, so it will be skipped.");
162 set session sql_log_bin=1;
163
164 --eval SET GLOBAL group_replication_clone_threshold= $_group_replication_threshold_save
165
166 RESET PERSIST IF EXISTS group_replication_group_name;
167 RESET PERSIST IF EXISTS group_replication_local_address;
168 RESET PERSIST IF EXISTS group_replication_group_seeds;
169 RESET PERSIST IF EXISTS group_replication_start_on_boot;
170 RESET PERSIST IF EXISTS group_replication_communication_stack;
171
172 --replace_result $_group_replication_start_on_boot START_ON_BOOT_VALUE
173 --eval SET GLOBAL group_replication_start_on_boot= $_group_replication_start_on_boot
174
175 --source include/clean_monitoring_process.inc
176
177 UNINSTALL PLUGIN clone;
178
179 --let $rpl_connection_name= server1
180 --source include/rpl_connection.inc
181
182 UNINSTALL PLUGIN clone;
183
184 --source include/group_replication_end.inc