Skip to content

Commit 78c5008

Browse files
Bug#36440609 Reinstate Group Replication Tests with PAXOS Single Leader enabled
Description: ----------- Group Replication test suite has some tests failing when we enabled PAXOS Single Leader. In order to solve and diagnose issues regarding its usage, we need to have a test suite running regularly with PAXOS Single Leader = ON Analysis and Fix: ---------- All failures are related with the tests themselves, due to not preserving the paxos_single_leader variable value between restarts or not accounting for it to be enabled. Change-Id: I106f0ea5d37f6ec0b6b06a6321a00fe2671ebf5b
1 parent 9109cb4 commit 78c5008

20 files changed

+101
-26
lines changed

mysql-test/collections/default.weekly

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ perl mysql-test-run.pl --timer --force --parallel=6 --comment=group_replication_
184184
#GR with group_replication_ssl_mode = REQUIRED and MySQL Stack
185185
perl mysql-test-run.pl --timer --force --parallel=6 --comment=group_replication_ssl_mode_required_mysql --vardir=var-gr_ssl_mode_required_mysql --suite=group_replication --big-test --testcase-timeout=60 --suite-timeout=360 --mysqld=--loose-group_replication_ssl_mode=REQUIRED --mysqld=--loose-group_replication_communication_stack=MySQL
186186

187+
#GR with MySQL Stack and Single Leader
188+
perl mysql-test-run.pl --timer --force --parallel=6 --comment=group_replication_mysql_single_leader --vardir=var-gr_mysql_single_leader --suite=group_replication --big-test --testcase-timeout=60 --suite-timeout=360 --mysqld=--loose-group_replication_communication_stack=MySQL --mysqld=--loose-group_replication_paxos_single_leader=ON
189+
187190
#
188191
# b) DEBUG
189192
#

mysql-test/include/gr_assert_multi_primary_mode.inc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
--let $assert_cond= [SELECT @@GLOBAL.group_replication_single_primary_mode] = 0
2020
--source include/assert.inc
2121

22-
--let $assert_text= group_replication_enforce_update_everywhere_checks is ON
23-
--let $assert_cond= [SELECT @@GLOBAL.group_replication_enforce_update_everywhere_checks] = "1"
24-
--source include/assert.inc
22+
--let $wait_condition= SELECT @@GLOBAL.group_replication_enforce_update_everywhere_checks = '1'
23+
--source include/wait_condition_or_abort.inc
2524

2625
--let $assert_text= 'No secondaries on the group'
2726
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_members WHERE member_role="SECONDARY"] = 0

mysql-test/include/gr_assert_primary_member.inc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
--let $assert_cond= [SELECT @@GLOBAL.group_replication_single_primary_mode] = 1
1919
--source include/assert.inc
2020

21-
--let $assert_text= group_replication_enforce_update_everywhere_checks is OFF
22-
--let $assert_cond= [SELECT @@GLOBAL.group_replication_enforce_update_everywhere_checks] = "0"
23-
--source include/assert.inc
21+
--let $wait_condition= SELECT @@GLOBAL.group_replication_enforce_update_everywhere_checks = '0'
22+
--source include/wait_condition_or_abort.inc
2423

2524
--let $assert_text= 'There only exist one primary'
2625
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_members WHERE member_role="PRIMARY"] = 1

mysql-test/include/gr_assert_secondary_member.inc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
--let $assert_cond= [SELECT @@GLOBAL.group_replication_single_primary_mode] = 1
1515
--source include/assert.inc
1616

17-
--let $assert_text= group_replication_enforce_update_everywhere_checks is OFF
18-
--let $assert_cond= [SELECT @@GLOBAL.group_replication_enforce_update_everywhere_checks] = "0"
19-
--source include/assert.inc
17+
--let $wait_condition= SELECT @@GLOBAL.group_replication_enforce_update_everywhere_checks = '0'
18+
--source include/wait_condition_or_abort.inc
2019

2120
--let $assert_text= 'There only exist one primary'
2221
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_members WHERE member_role="PRIMARY"] = 1
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# ==== Purpose ====
2+
#
3+
# Ensure that group replication is running with Paxos Single Leader disabled
4+
#
5+
6+
--let $_have_paxos_single_leader= `SELECT @@group_replication_paxos_single_leader`
7+
if ($_have_paxos_single_leader)
8+
{
9+
--skip Test requires Paxos Single Leader disabled in Group Replication
10+
}

mysql-test/include/spawn_monitoring_process.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ if (!$have_windows) {
7777
OR VARIABLE_NAME LIKE 'group_replication_recovery_ssl_ca'
7878
OR VARIABLE_NAME LIKE 'group_replication_recovery_ssl_cert'
7979
OR VARIABLE_NAME LIKE 'group_replication_recovery_ssl_key'
80+
OR VARIABLE_NAME LIKE 'group_replication_communication_stack'
81+
OR VARIABLE_NAME LIKE 'group_replication_paxos_single_leader'
8082
ORDER BY VARIABLE_NAME;
8183

8284
# Ensure that next auto_increment values are consecutive.

mysql-test/suite/group_replication/r/gr_acf_receiver_network_partition.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ include/assert.inc ['The version of replication_asynchronous_connection_failover
9797

9898
############################################################
9999
# 10. Clean up.
100-
[connection server2]
100+
[connection server1]
101101
include/stop_group_replication.inc
102102
include/rpl/reset_replica.inc
103-
[connection server1]
103+
[connection server2]
104104
include/stop_group_replication.inc
105105
include/rpl/reset_replica.inc
106106
[connection server4]

mysql-test/suite/group_replication/r/gr_singlewriter_paxos_single_writer_and_communication_protocol_version.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ ERROR HY000: The function 'group_replication_set_communication_protocol' failed.
9191
# 10) Cleanup.
9292
##
9393
[connection server3]
94-
SET GLOBAL group_replication_paxos_single_leader = "OFF";
94+
SET GLOBAL group_replication_paxos_single_leader = PAXOS_SINGLE_LEADER;
9595
[connection server2]
96-
SET GLOBAL group_replication_paxos_single_leader = "OFF";
96+
SET GLOBAL group_replication_paxos_single_leader = PAXOS_SINGLE_LEADER;
9797
[connection server1]
98-
SET GLOBAL group_replication_paxos_single_leader = "OFF";
98+
SET GLOBAL group_replication_paxos_single_leader = PAXOS_SINGLE_LEADER;
9999
include/group_replication_end.inc

mysql-test/suite/group_replication/r/gr_singlewriter_perfschema.result

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ Warnings:
33
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
44
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
55
[connection server1]
6+
SET GLOBAL group_replication_paxos_single_leader = 0;
7+
include/start_and_bootstrap_group_replication.inc
8+
[connection server2]
9+
SET GLOBAL group_replication_paxos_single_leader = 0;
10+
include/start_group_replication.inc
11+
[connection server3]
12+
SET GLOBAL group_replication_paxos_single_leader = 0;
13+
include/start_group_replication.inc
14+
[connection server1]
615
[connection server1]
716
include/assert.inc [group_replication_paxos_single_leader must be disabled]
817
[connection server2]
@@ -105,11 +114,11 @@ include/assert.inc [group_replication_paxos_single_leader must be enabled]
105114
include/assert.inc [group_replication_paxos_single_leader must be enabled]
106115
[connection server3]
107116
include/stop_group_replication.inc
108-
SET GLOBAL group_replication_paxos_single_leader = 0;
117+
SET GLOBAL group_replication_paxos_single_leader = PAXOS_SINGLE_LEADER;
109118
[connection server2]
110119
include/stop_group_replication.inc
111-
SET GLOBAL group_replication_paxos_single_leader = 0;
120+
SET GLOBAL group_replication_paxos_single_leader = PAXOS_SINGLE_LEADER;
112121
[connection server1]
113122
include/stop_group_replication.inc
114-
SET GLOBAL group_replication_paxos_single_leader = 0;
123+
SET GLOBAL group_replication_paxos_single_leader = PAXOS_SINGLE_LEADER;
115124
include/group_replication_end.inc

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ SET SESSION sql_log_bin= 1;
290290
--echo
291291
--echo ############################################################
292292
--echo # 10. Clean up.
293-
--let $rpl_connection_name= server2
293+
--let $rpl_connection_name= server1
294294
--source include/connection.inc
295295
--source include/stop_group_replication.inc
296296

@@ -301,7 +301,7 @@ SET SESSION sql_log_bin= 1;
301301
--let $rpl_channel_name=
302302
--let $rpl_multi_source=
303303

304-
--let $rpl_connection_name= server1
304+
--let $rpl_connection_name= server2
305305
--source include/connection.inc
306306
--source include/stop_group_replication.inc
307307

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--group_replication_paxos_single_leader=OFF
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--group_replication_paxos_single_leader=OFF
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--group_replication_paxos_single_leader=OFF
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--group_replication_paxos_single_leader=OFF
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--group_replication_paxos_single_leader=OFF
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--group_replication_paxos_single_leader=OFF

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@
3030
# so define event_sequence for assert_binlog_events.inc
3131
# 7. Verify that all members data is equal.
3232
# 8. Clean up.
33+
#
34+
# NOTE: This test can't run with Single Leader enabled
35+
# because the 3rd member will never be able to contact
36+
# the leader to send messages on his behalf, due to the fact
37+
# it is not accepting any MySQL client connections.
3338
###########################################################
3439

40+
--source include/have_group_replication_paxos_single_leader_disabled.inc
3541
--source include/big_test.inc
3642
--source include/have_debug.inc
3743
--source include/have_group_replication_mysql_communication_stack.inc

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@
2828
# 5. Wait server3 to be ONLINE
2929
# 6. Verify that all members data is equal.
3030
# 7. Clean up.
31+
#
32+
# NOTE: This test can't run with Single Leader enabled
33+
# because the 3rd member will never be able to contact
34+
# the leader to send messages on his behalf, due to the fact
35+
# it is not accepting any MySQL client connections.
3136
###########################################################
3237

38+
--source include/have_group_replication_paxos_single_leader_disabled.inc
3339
--source include/big_test.inc
3440
--source include/have_debug.inc
3541
--source include/have_group_replication_mysql_communication_stack.inc

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,15 @@ SET SESSION sql_log_bin = 1;
4545

4646
--let $rpl_connection_name= server1
4747
--source include/connection.inc
48+
49+
--let $_group_replication_single_leader_s1= `SELECT @@GLOBAL.group_replication_paxos_single_leader`
4850
--eval SET GLOBAL group_replication_paxos_single_leader = "OFF"
4951
--source include/start_and_bootstrap_group_replication.inc
5052

5153
--let $rpl_connection_name= server2
5254
--source include/connection.inc
55+
56+
--let $_group_replication_single_leader_s2= `SELECT @@GLOBAL.group_replication_paxos_single_leader`
5357
--eval SET GLOBAL group_replication_paxos_single_leader = "OFF"
5458
--source include/start_group_replication.inc
5559

@@ -67,6 +71,9 @@ SET SESSION sql_log_bin = 1;
6771

6872
--let $rpl_connection_name= server3
6973
--source include/connection.inc
74+
75+
--let $_group_replication_single_leader_s3= `SELECT @@GLOBAL.group_replication_paxos_single_leader`
76+
7077
--eval SET GLOBAL group_replication_paxos_single_leader = "ON"
7178

7279
# Verify that START fails for group_replication
@@ -181,14 +188,17 @@ START GROUP_REPLICATION;
181188

182189
--let $rpl_connection_name= server3
183190
--source include/connection.inc
184-
--eval SET GLOBAL group_replication_paxos_single_leader = "OFF"
191+
--replace_result $_group_replication_single_leader_s3 PAXOS_SINGLE_LEADER
192+
--eval SET GLOBAL group_replication_paxos_single_leader = $_group_replication_single_leader_s3
185193

186194
--let $rpl_connection_name= server2
187195
--source include/connection.inc
188-
--eval SET GLOBAL group_replication_paxos_single_leader = "OFF"
196+
--replace_result $_group_replication_single_leader_s2 PAXOS_SINGLE_LEADER
197+
--eval SET GLOBAL group_replication_paxos_single_leader = $_group_replication_single_leader_s2
189198

190199
--let $rpl_connection_name= server1
191200
--source include/connection.inc
192-
--eval SET GLOBAL group_replication_paxos_single_leader = "OFF"
201+
--replace_result $_group_replication_single_leader_s1 PAXOS_SINGLE_LEADER
202+
--eval SET GLOBAL group_replication_paxos_single_leader = $_group_replication_single_leader_s1
193203

194204
--source include/group_replication_end.inc

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

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,32 @@
2727

2828
# 1. Start GR group with 3 servers
2929
--let $rpl_server_count = 3
30+
--let $rpl_skip_group_replication_start= 1
3031
--source include/group_replication.inc
3132

33+
--let $_group_replication_single_leader_s1= `SELECT @@GLOBAL.group_replication_paxos_single_leader`
34+
SET GLOBAL group_replication_paxos_single_leader = 0;
35+
--source include/start_and_bootstrap_group_replication.inc
36+
37+
--let $rpl_connection_name= server2
38+
--source include/connection.inc
39+
40+
--let $_group_replication_single_leader_s2= `SELECT @@GLOBAL.group_replication_paxos_single_leader`
41+
SET GLOBAL group_replication_paxos_single_leader = 0;
42+
--source include/start_group_replication.inc
43+
44+
--let $rpl_connection_name= server3
45+
--source include/connection.inc
46+
47+
--let $_group_replication_single_leader_s3= `SELECT @@GLOBAL.group_replication_paxos_single_leader`
48+
SET GLOBAL group_replication_paxos_single_leader = 0;
49+
--source include/start_group_replication.inc
50+
3251
# 2. Value of WRITE_CONSENSUS_SINGLE_LEADER_CAPABLE is 0 on all servers.
52+
53+
--let $rpl_connection_name= server1
54+
--source include/connection.inc
55+
3356
--let $single_leader_capable = 0
3457
--source include/gr_assert_write_consensus_single_leader_capable.inc
3558

@@ -168,22 +191,25 @@ SELECT group_replication_set_communication_protocol("8.0.27");
168191

169192
# Cleanup
170193

171-
# Change the value to 0 in all servers and restart GR.
194+
# Change the value to initial in all servers and restart GR.
172195

173196
--let $rpl_connection_name= server3
174197
--source include/connection.inc
175198
--source include/stop_group_replication.inc
176-
SET GLOBAL group_replication_paxos_single_leader = 0;
199+
--replace_result $_group_replication_single_leader_s3 PAXOS_SINGLE_LEADER
200+
--eval SET GLOBAL group_replication_paxos_single_leader = $_group_replication_single_leader_s3
177201

178202
--let $rpl_connection_name= server2
179203
--source include/connection.inc
180204
--source include/stop_group_replication.inc
181-
SET GLOBAL group_replication_paxos_single_leader = 0;
205+
--replace_result $_group_replication_single_leader_s2 PAXOS_SINGLE_LEADER
206+
--eval SET GLOBAL group_replication_paxos_single_leader = $_group_replication_single_leader_s2
182207

183208
--let $rpl_connection_name= server1
184209
--source include/connection.inc
185210
--source include/stop_group_replication.inc
186-
SET GLOBAL group_replication_paxos_single_leader = 0;
211+
--replace_result $_group_replication_single_leader_s1 PAXOS_SINGLE_LEADER
212+
--eval SET GLOBAL group_replication_paxos_single_leader = $_group_replication_single_leader_s1
187213

188214
--let $rpl_group_replication_reset_persistent_vars= 1
189215
--source include/group_replication_end.inc

0 commit comments

Comments
 (0)