File: gr_parallel_start_uninstall.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (165 lines) | stat: -rw-r--r-- 7,091 bytes parent folder | download
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
################################################################################
# This test proves parallel execution of START GR and UNINSTALL is safe.
#
# Test:
# 0. The test requires two servers: M1 and M2.
# 1. Bootstrap M1.
# 2. Set parameters for server 2 for start gr.
# 3. Check parallel UNINSTALL with START GR.
# 4. START GR without credentials it should fail.
#    Credentials deleted by UNINSTALL.
# 5. Check parallel START GR with UNINSTALL.
# 6. Cleanup.
################################################################################
--source include/have_debug_sync.inc
--source include/have_group_replication_xcom_communication_stack.inc
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc

--echo
--echo # 1. Bootstrap M1.

--let $rpl_connection_name= server1
--source include/rpl_connection.inc

--source include/start_and_bootstrap_group_replication.inc

--echo
--echo # 2. Set parameters for server 2 for start gr.

--let $rpl_connection_name= server2
--source include/rpl_connection.inc

RESET SLAVE ALL FOR CHANNEL 'group_replication_recovery';

SET @saved_group_replication_group_seeds = @@GLOBAL.group_replication_group_seeds;
SET @saved_group_replication_local_address = @@GLOBAL.group_replication_local_address;

--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"

SET @debug_save= @@GLOBAL.DEBUG;

--echo
--echo # 3. Check parallel UNINSTALL with START GR.

SET @@GLOBAL.DEBUG='+d,group_replication_wait_on_start';
SET @@GLOBAL.DEBUG='+d,group_replication_hold_stop_before_leave_the_group';

--send START GROUP_REPLICATION USER='root' , PASSWORD='';

--let $rpl_connection_name= server_2_1
--source include/rpl_connection.inc

SET DEBUG_SYNC='now wait_for signal.start_waiting';

--send UNINSTALL PLUGIN group_replication;

--let $rpl_connection_name= server_2
--source include/rpl_connection.inc

SET DEBUG_SYNC='now signal signal.start_continue';

# START GR will get stuck in plugin_lock.
# So we need to unlock UNINSTALL thread also.
SET DEBUG_SYNC='now signal signal.resume_stop_before_leave_the_group';

--let $rpl_connection_name= server2
--source include/rpl_connection.inc

--reap

--let $rpl_connection_name= server_2_1
--source include/rpl_connection.inc

--reap

--let $rpl_connection_name= server2
--source include/rpl_connection.inc

--let $assert_text= group_replication plugin is uninstalled
--let $assert_cond= [SELECT COUNT(*) AS count FROM information_schema.plugins WHERE PLUGIN_NAME="group_replication" AND PLUGIN_STATUS="ACTIVE", count, 1] = 0
--source include/assert.inc

--echo # 4. START GR without credentials it should fail.
--echo #    Credentials deleted by UNINSTALL.

SET @@GLOBAL.DEBUG= @debug_save;
SET DEBUG_SYNC = "reset";
SET GLOBAL super_read_only= FALSE;
--source include/install_group_replication_plugin.inc

SET @saved_group_replication_recovery_reconnect_interval = @@GLOBAL.group_replication_recovery_reconnect_interval;
SET @saved_gr_recovery_retry_count = @@GLOBAL.group_replication_recovery_retry_count;
SET @@GLOBAL.group_replication_group_seeds = @saved_group_replication_group_seeds;
SET @@GLOBAL.group_replication_local_address = @saved_group_replication_local_address;
SET GLOBAL group_replication_recovery_reconnect_interval= 1;
SET GLOBAL group_replication_recovery_retry_count= 2;
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"

START GROUP_REPLICATION;

--let $group_replication_member_state = ERROR
--source include/gr_wait_for_member_state.inc

--source include/stop_group_replication.inc

SET @@GLOBAL.group_replication_recovery_reconnect_interval = @saved_group_replication_recovery_reconnect_interval;
SET @@GLOBAL.group_replication_recovery_retry_count = @saved_gr_recovery_retry_count;

--echo
--echo # 5. Check parallel START GR with UNINSTALL.

SET @@GLOBAL.DEBUG='+d,group_replication_hold_stop_before_leave_the_group';

--send UNINSTALL PLUGIN group_replication;

--let $rpl_connection_name= server_2_1
--source include/rpl_connection.inc

--disable_result_log
--error 0, ER_GROUP_REPLICATION_CONFIGURATION, ER_GROUP_REPLICATION_COMMAND_FAILURE
START GROUP_REPLICATION USER='root' , PASSWORD='';
--enable_result_log

SET DEBUG_SYNC='now signal signal.resume_stop_before_leave_the_group';

--let $rpl_connection_name= server2
--source include/rpl_connection.inc

# Uninstall may emit warning plugin is busy
--disable_result_log
--error 0, ER_OPTION_PREVENTS_STATEMENT
--reap
--enable_result_log

--let $assert_text= group_replication plugin is uninstalled
--let $assert_cond= [SELECT COUNT(*) AS count FROM information_schema.plugins WHERE PLUGIN_NAME="group_replication" AND PLUGIN_STATUS="ACTIVE", count, 1] = 0
--source include/assert.inc

--echo
--echo # 6. Cleanup.

SET DEBUG_SYNC = "reset";
SET @@GLOBAL.DEBUG= @debug_save;
SET GLOBAL super_read_only= FALSE;
--source include/install_group_replication_plugin.inc
SET SESSION sql_log_bin = 0;
call mtr.add_suppression("Group Replication plugin is not installed.");
call mtr.add_suppression("Replica I/O for channel 'group_replication_recovery': Fatal error: Invalid .* username when attempting to connect to the source server.*");
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.");
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.");
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.");
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("Fatal error during the incremental recovery process of Group Replication. The server will leave the group.");
call mtr.add_suppression("Error while starting the group replication incremental recovery receiver/applier threads");
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
call mtr.add_suppression("Plugin 'group_replication' has ref_count=1 after deinitialization.");
SET SESSION sql_log_bin = 1;
CHANGE REPLICATION SOURCE TO SOURCE_USER='root' FOR CHANNEL 'group_replication_recovery';

--source include/group_replication_end.inc