Debian Codegraph @

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

raw
1 ################################################################################
2 # This test proves parallel execution of START GR and UNINSTALL is safe.
3 #
4 # Test:
5 # 0. The test requires two servers: M1 and M2.
6 # 1. Bootstrap M1.
7 # 2. Set parameters for server 2 for start gr.
8 # 3. Check parallel UNINSTALL with START GR.
9 # 4. START GR without credentials it should fail.
10 # Credentials deleted by UNINSTALL.
11 # 5. Check parallel START GR with UNINSTALL.
12 # 6. Cleanup.
13 ################################################################################
14 --source include/have_debug_sync.inc
15 --source include/have_group_replication_xcom_communication_stack.inc
16 --source include/have_group_replication_plugin.inc
17 --let $rpl_skip_group_replication_start= 1
18 --source include/group_replication.inc
19
20 --echo
21 --echo # 1. Bootstrap M1.
22
23 --let $rpl_connection_name= server1
24 --source include/rpl_connection.inc
25
26 --source include/start_and_bootstrap_group_replication.inc
27
28 --echo
29 --echo # 2. Set parameters for server 2 for start gr.
30
31 --let $rpl_connection_name= server2
32 --source include/rpl_connection.inc
33
34 RESET SLAVE ALL FOR CHANNEL 'group_replication_recovery';
35
36 SET @saved_group_replication_group_seeds = @@GLOBAL.group_replication_group_seeds;
37 SET @saved_group_replication_local_address = @@GLOBAL.group_replication_local_address;
38
39 --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
40 --eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
41
42 SET @debug_save= @@GLOBAL.DEBUG;
43
44 --echo
45 --echo # 3. Check parallel UNINSTALL with START GR.
46
47 SET @@GLOBAL.DEBUG='+d,group_replication_wait_on_start';
48 SET @@GLOBAL.DEBUG='+d,group_replication_hold_stop_before_leave_the_group';
49
50 --send START GROUP_REPLICATION USER='root' , PASSWORD='';
51
52 --let $rpl_connection_name= server_2_1
53 --source include/rpl_connection.inc
54
55 SET DEBUG_SYNC='now wait_for signal.start_waiting';
56
57 --send UNINSTALL PLUGIN group_replication;
58
59 --let $rpl_connection_name= server_2
60 --source include/rpl_connection.inc
61
62 SET DEBUG_SYNC='now signal signal.start_continue';
63
64 # START GR will get stuck in plugin_lock.
65 # So we need to unlock UNINSTALL thread also.
66 SET DEBUG_SYNC='now signal signal.resume_stop_before_leave_the_group';
67
68 --let $rpl_connection_name= server2
69 --source include/rpl_connection.inc
70
71 --reap
72
73 --let $rpl_connection_name= server_2_1
74 --source include/rpl_connection.inc
75
76 --reap
77
78 --let $rpl_connection_name= server2
79 --source include/rpl_connection.inc
80
81 --let $assert_text= group_replication plugin is uninstalled
82 --let $assert_cond= [SELECT COUNT(*) AS count FROM information_schema.plugins WHERE PLUGIN_NAME="group_replication" AND PLUGIN_STATUS="ACTIVE", count, 1] = 0
83 --source include/assert.inc
84
85 --echo # 4. START GR without credentials it should fail.
86 --echo # Credentials deleted by UNINSTALL.
87
88 SET @@GLOBAL.DEBUG= @debug_save;
89 SET DEBUG_SYNC = "reset";
90 SET GLOBAL super_read_only= FALSE;
91 --source include/install_group_replication_plugin.inc
92
93 SET @saved_group_replication_recovery_reconnect_interval = @@GLOBAL.group_replication_recovery_reconnect_interval;
94 SET @saved_gr_recovery_retry_count = @@GLOBAL.group_replication_recovery_retry_count;
95 SET @@GLOBAL.group_replication_group_seeds = @saved_group_replication_group_seeds;
96 SET @@GLOBAL.group_replication_local_address = @saved_group_replication_local_address;
97 SET GLOBAL group_replication_recovery_reconnect_interval= 1;
98 SET GLOBAL group_replication_recovery_retry_count= 2;
99 --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
100 --eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
101
102 START GROUP_REPLICATION;
103
104 --let $group_replication_member_state = ERROR
105 --source include/gr_wait_for_member_state.inc
106
107 --source include/stop_group_replication.inc
108
109 SET @@GLOBAL.group_replication_recovery_reconnect_interval = @saved_group_replication_recovery_reconnect_interval;
110 SET @@GLOBAL.group_replication_recovery_retry_count = @saved_gr_recovery_retry_count;
111
112 --echo
113 --echo # 5. Check parallel START GR with UNINSTALL.
114
115 SET @@GLOBAL.DEBUG='+d,group_replication_hold_stop_before_leave_the_group';
116
117 --send UNINSTALL PLUGIN group_replication;
118
119 --let $rpl_connection_name= server_2_1
120 --source include/rpl_connection.inc
121
122 --disable_result_log
123 --error 0, ER_GROUP_REPLICATION_CONFIGURATION, ER_GROUP_REPLICATION_COMMAND_FAILURE
124 START GROUP_REPLICATION USER='root' , PASSWORD='';
125 --enable_result_log
126
127 SET DEBUG_SYNC='now signal signal.resume_stop_before_leave_the_group';
128
129 --let $rpl_connection_name= server2
130 --source include/rpl_connection.inc
131
132 # Uninstall may emit warning plugin is busy
133 --disable_result_log
134 --error 0, ER_OPTION_PREVENTS_STATEMENT
135 --reap
136 --enable_result_log
137
138 --let $assert_text= group_replication plugin is uninstalled
139 --let $assert_cond= [SELECT COUNT(*) AS count FROM information_schema.plugins WHERE PLUGIN_NAME="group_replication" AND PLUGIN_STATUS="ACTIVE", count, 1] = 0
140 --source include/assert.inc
141
142 --echo
143 --echo # 6. Cleanup.
144
145 SET DEBUG_SYNC = "reset";
146 SET @@GLOBAL.DEBUG= @debug_save;
147 SET GLOBAL super_read_only= FALSE;
148 --source include/install_group_replication_plugin.inc
149 SET SESSION sql_log_bin = 0;
150 call mtr.add_suppression("Group Replication plugin is not installed.");
151 call mtr.add_suppression("Replica I/O for channel 'group_replication_recovery': Fatal error: Invalid .* username when attempting to connect to the source server.*");
152 call mtr.add_suppression("There was an error when connecting to the donor server. Please check that group_replication_recovery channel credentials and all MEMBER_HOST column values of performance_schema.replication_group_members table are correct and DNS resolvable.");
153 call mtr.add_suppression("For details please check performance_schema.replication_connection_status table and error log messages of Replica I/O for channel group_replication_recovery.");
154 call mtr.add_suppression("There was an error when connecting to the donor server. Please check that group_replication_recovery channel credentials and all MEMBER_HOST column values of performance_schema.replication_group_members table are correct and DNS resolvable.");
155 call mtr.add_suppression("Maximum number of retries when trying to connect to a donor reached. Aborting group replication incremental recovery.");
156 call mtr.add_suppression("Fatal error during the incremental recovery process of Group Replication. The server will leave the group.");
157 call mtr.add_suppression("Error while starting the group replication incremental recovery receiver/applier threads");
158 call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
159 call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
160 call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
161 call mtr.add_suppression("Plugin 'group_replication' has ref_count=1 after deinitialization.");
162 SET SESSION sql_log_bin = 1;
163 CHANGE REPLICATION SOURCE TO SOURCE_USER='root' FOR CHANNEL 'group_replication_recovery';
164
165 --source include/group_replication_end.inc