Skip to content

Commit 6f9332b

Browse files
author
Jaideep Karande
committed
Bug#27067956: TEST GR_APPLIER_SLAVE_COMMANDS FAILS SPORADICALY ON PB2
STOP START STOP GR Applier is causing additional warnings being logged in error file because of previous pending operations. Test case has been changed to use wait when required.
1 parent 86e07a0 commit 6f9332b

File tree

2 files changed

+28
-16
lines changed

2 files changed

+28
-16
lines changed

rapid/plugin/group_replication/tests/mtr/r/gr_applier_slave_commands.result

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,22 @@ SHOW SLAVE STATUS FOR CHANNEL 'group_replication_applier';
3838
ERROR HY000: SHOW SLAVE STATUS cannot be performed on channel 'group_replication_applier'.
3939

4040
# START SLAVE SQL_THREAD command will work for group_replication_applier
41-
START SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
41+
include/gr_start_applier_sql_thread.inc
42+
START SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier";
4243
Warnings:
4344
Note 3083 Replication thread(s) for channel 'group_replication_applier' are already runnning.
4445

4546
# STOP SLAVE SQL_THREAD command will work for group_replication_applier
46-
STOP SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
47+
include/gr_stop_applier_sql_thread.inc
48+
STOP SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier";
4749
# START SLAVE SQL_THREAD with UNTIL option will work for group_replication_applier
4850
START SLAVE SQL_THREAD UNTIL SQL_BEFORE_GTIDS='11111111-1111-1111-1111-111111111111:1-23' FOR CHANNEL 'group_replication_applier';
49-
STOP SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
51+
include/gr_stop_applier_sql_thread.inc
52+
STOP SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier";
5053
# START SLAVE SQL_THREAD with UNTIL option will work for group_replication_applier
5154
START SLAVE SQL_THREAD UNTIL RELAY_LOG_FILE = 'server-relay-log-group_replication_applier.000002', RELAY_LOG_POS = 10000 FOR CHANNEL 'group_replication_applier';
52-
STOP SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
55+
include/gr_stop_applier_sql_thread.inc
56+
STOP SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier";
5357

5458
# SHOW RELAYLOG EVENTS for channel will work for all channels
5559
include/assert.inc [Relay log name should not be empty as the command successfully executed.]
@@ -85,10 +89,12 @@ SHOW SLAVE STATUS FOR CHANNEL 'group_replication_applier';
8589
ERROR HY000: SHOW SLAVE STATUS cannot be performed on channel 'group_replication_applier'.
8690

8791
# START SLAVE SQL_THREAD command will work for group_replication_applier
88-
START SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
92+
include/gr_start_applier_sql_thread.inc
93+
START SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier";
8994

9095
# STOP SLAVE SQL_THREAD command will work for group_replication_applier
91-
STOP SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
96+
include/gr_stop_applier_sql_thread.inc
97+
STOP SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier";
9298

9399
# SHOW RELAYLOG EVENTS for channel will work for all channels
94100
include/assert.inc [Relay log name should not be empty as the command successfully executed.]
@@ -111,7 +117,8 @@ include/start_group_replication.inc
111117
include/stop_group_replication.inc
112118
RESET SLAVE ALL FOR CHANNEL "group_replication_applier";
113119
include/start_group_replication.inc
114-
STOP SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
120+
include/gr_stop_applier_sql_thread.inc
121+
STOP SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier";
115122
# RESET SLAVE should not be allowed when GR is ONLINE.
116123
# So this command will fail.
117124
RESET SLAVE FOR CHANNEL "group_replication_applier";
@@ -120,7 +127,8 @@ ERROR HY000: RESET SLAVE [ALL] FOR CHANNEL cannot be performed on channel 'group
120127
# So this command will fail.
121128
RESET SLAVE ALL FOR CHANNEL "group_replication_applier";
122129
ERROR HY000: RESET SLAVE [ALL] FOR CHANNEL cannot be performed on channel 'group_replication_applier'.
123-
START SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
130+
include/gr_start_applier_sql_thread.inc
131+
START SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier";
124132
# stop the channel and try reset slave for channel again. It should work.
125133
include/stop_group_replication.inc
126134
RESET SLAVE ALL FOR CHANNEL "group_replication_applier";

rapid/plugin/group_replication/tests/mtr/t/gr_applier_slave_commands.test

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,28 +114,32 @@ SHOW SLAVE STATUS FOR CHANNEL 'group_replication_applier';
114114

115115
--echo
116116
--echo # START SLAVE SQL_THREAD command will work for group_replication_applier
117-
START SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
117+
--source ../inc/gr_start_applier_sql_thread.inc
118118

119119
--echo
120120
--echo # STOP SLAVE SQL_THREAD command will work for group_replication_applier
121-
STOP SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
121+
--source ../inc/gr_stop_applier_sql_thread.inc
122122

123123
--echo # START SLAVE SQL_THREAD with UNTIL option will work for group_replication_applier
124124
--disable_warnings
125125
START SLAVE SQL_THREAD UNTIL SQL_BEFORE_GTIDS='11111111-1111-1111-1111-111111111111:1-23' FOR CHANNEL 'group_replication_applier';
126+
--let $wait_condition= SELECT service_state="ON" FROM performance_schema.replication_applier_status WHERE channel_name="group_replication_applier"
127+
--source include/wait_condition.inc
126128
--enable_warnings
127129

128130
--disable_warnings
129-
STOP SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
131+
--source ../inc/gr_stop_applier_sql_thread.inc
130132
--enable_warnings
131133

132134
--echo # START SLAVE SQL_THREAD with UNTIL option will work for group_replication_applier
133135
--disable_warnings
134136
START SLAVE SQL_THREAD UNTIL RELAY_LOG_FILE = 'server-relay-log-group_replication_applier.000002', RELAY_LOG_POS = 10000 FOR CHANNEL 'group_replication_applier';
137+
--let $wait_condition= SELECT service_state="ON" FROM performance_schema.replication_applier_status WHERE channel_name="group_replication_applier"
138+
--source include/wait_condition.inc
135139
--enable_warnings
136140

137141
--disable_warnings
138-
STOP SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
142+
--source ../inc/gr_stop_applier_sql_thread.inc
139143
--enable_warnings
140144

141145
--echo
@@ -188,11 +192,11 @@ SHOW SLAVE STATUS FOR CHANNEL 'group_replication_applier';
188192

189193
--echo
190194
--echo # START SLAVE SQL_THREAD command will work for group_replication_applier
191-
START SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
195+
--source ../inc/gr_start_applier_sql_thread.inc
192196

193197
--echo
194198
--echo # STOP SLAVE SQL_THREAD command will work for group_replication_applier
195-
STOP SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
199+
--source ../inc/gr_stop_applier_sql_thread.inc
196200

197201
--echo
198202
--echo # SHOW RELAYLOG EVENTS for channel will work for all channels
@@ -232,7 +236,7 @@ RESET SLAVE ALL FOR CHANNEL "group_replication_applier";
232236

233237
# RESET SLAVE should not be allowed when Group_replication is running.
234238
--source include/start_group_replication.inc
235-
STOP SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
239+
--source ../inc/gr_stop_applier_sql_thread.inc
236240
--echo # RESET SLAVE should not be allowed when GR is ONLINE.
237241
--echo # So this command will fail.
238242
--error ER_SLAVE_CHANNEL_OPERATION_NOT_ALLOWED
@@ -242,7 +246,7 @@ RESET SLAVE FOR CHANNEL "group_replication_applier";
242246
--echo # So this command will fail.
243247
--error ER_SLAVE_CHANNEL_OPERATION_NOT_ALLOWED
244248
RESET SLAVE ALL FOR CHANNEL "group_replication_applier";
245-
START SLAVE SQL_THREAD FOR CHANNEL 'group_replication_applier';
249+
--source ../inc/gr_start_applier_sql_thread.inc
246250

247251
--echo # stop the channel and try reset slave for channel again. It should work.
248252
--source include/stop_group_replication.inc

0 commit comments

Comments
 (0)