Debian Codegraph @

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

raw
1 ################################################################################
2 # Validate that a 8.0.35 server can join a group in single-primary mode which
3 # version is a higher 8.0 patch version.
4 #
5 # Test:
6 # 0. The test requires three servers: M1, M2 and M3.
7 # 1. Bootstrap the group with a server that is one patch version
8 # higher than the current version (8.0.35 or higher).
9 # 2. Join a server that is one patch version
10 # higher than the current version (8.0.35 or higher).
11 # 3. Join a 8.0.35 to the group.
12 # 4. Validate that the group has one primary and two secondaries.
13 # 5. Try to make server2, a higher version, the primary.
14 # It must fail.
15 # 6. After the primary, server1, leaves, server3 is the new
16 # primary.
17 # 7. Clean up.
18 ################################################################################
19 --source include/have_debug.inc
20 --source include/have_group_replication_plugin.inc
21 --let $rpl_group_replication_single_primary_mode =1
22 --let $rpl_server_count= 3
23 --let $rpl_skip_group_replication_start= 1
24 --source include/group_replication.inc
25
26
27 --echo
28 --echo ############################################################
29 --echo # 1. Bootstrap the group with a server that is one patch version
30 --echo # higher than the current version (8.0.35 or higher).
31 --let $rpl_connection_name= server1
32 --source include/rpl_connection.inc
33 SET SESSION sql_log_bin= 0;
34 call mtr.add_suppression("Error while executing a group configuration operation: Error processing configuration start message: The appointed primary member has a version that is greater than the one of some of the members in the group.");
35 SET SESSION sql_log_bin= 1;
36
37 SET @@GLOBAL.DEBUG= '+d,group_replication_compatibility_higher_patch_version';
38 --source include/start_and_bootstrap_group_replication.inc
39
40
41 --echo
42 --echo ############################################################
43 --echo # 2. Join a server that is one patch version
44 --echo # higher than the current version (8.0.35 or higher).
45 --let $rpl_connection_name= server2
46 --source include/rpl_connection.inc
47 SET SESSION sql_log_bin= 0;
48 call mtr.add_suppression("The function 'group_replication_set_as_primary' failed. Error processing configuration start message: The appointed primary member has a version that is greater than the one of some of the members in the group.");
49 SET SESSION sql_log_bin= 1;
50
51 --let $server2_uuid = `SELECT @@server_uuid`
52 SET @@GLOBAL.DEBUG= '+d,group_replication_compatibility_higher_patch_version';
53 --source include/start_group_replication.inc
54
55
56 --echo
57 --echo ############################################################
58 --echo # 3. Join a 8.0.35 to the group.
59 --let $rpl_connection_name= server3
60 --source include/rpl_connection.inc
61 SET SESSION sql_log_bin= 0;
62 call mtr.add_suppression("Error while executing a group configuration operation: Error processing configuration start message: The appointed primary member has a version that is greater than the one of some of the members in the group.");
63 SET SESSION sql_log_bin= 1;
64
65 --let $server3_uuid = `SELECT @@server_uuid`
66 SET @@GLOBAL.DEBUG= '+d,group_replication_version_8_0_35';
67 --source include/start_group_replication.inc
68
69 --replace_result $server3_uuid SERVER3_UUID
70 --eval SELECT MEMBER_STATE, MEMBER_ROLE, MEMBER_VERSION FROM performance_schema.replication_group_members WHERE MEMBER_ID='$server3_uuid'
71
72
73 --echo
74 --echo ############################################################
75 --echo # 4. Validate that the group has one primary and two secondaries.
76 --let $rpl_connection_name= server1
77 --source include/rpl_connection.inc
78 --let $group_replication_number_of_members = 3
79 --source include/gr_wait_for_number_of_members.inc
80
81 --source include/gr_assert_primary_member.inc
82
83 --let $rpl_connection_name= server2
84 --source include/rpl_connection.inc
85 --source include/gr_assert_secondary_member.inc
86
87 --let $rpl_connection_name= server3
88 --source include/rpl_connection.inc
89 --source include/gr_assert_secondary_member.inc
90
91
92 --echo
93 --echo ############################################################
94 --echo # 5. Try to make server2, a higher version, the primary.
95 --echo # It must fail.
96 --let $rpl_connection_name= server2
97 --source include/rpl_connection.inc
98 --replace_result $server2_uuid SERVER2_UUID
99 --error ER_GRP_RPL_UDF_ERROR
100 --eval SELECT group_replication_set_as_primary("$server2_uuid")
101
102 --source include/gr_assert_secondary_member.inc
103
104 --let $rpl_connection_name= server1
105 --source include/rpl_connection.inc
106 --source include/gr_assert_primary_member.inc
107
108 --let $rpl_connection_name= server3
109 --source include/rpl_connection.inc
110 --source include/gr_assert_secondary_member.inc
111
112
113 --echo
114 --echo ############################################################
115 --echo # 6. After the primary, server1, leaves, server3 is the new
116 --echo # primary.
117 --let $rpl_connection_name= server1
118 --source include/rpl_connection.inc
119 --source include/stop_group_replication.inc
120
121 --let $rpl_connection_name= server3
122 --source include/rpl_connection.inc
123 --let $group_replication_number_of_members = 2
124 --source include/gr_wait_for_number_of_members.inc
125
126 --source include/gr_assert_primary_member.inc
127
128 --let $rpl_connection_name= server2
129 --source include/rpl_connection.inc
130 --source include/gr_assert_secondary_member.inc
131
132
133 --echo
134 --echo ############################################################
135 --echo # 7. Clean up.
136 --let $rpl_connection_name= server1
137 --source include/rpl_connection.inc
138 SET @@GLOBAL.DEBUG= '-d,group_replication_compatibility_higher_patch_version';
139
140 --let $rpl_connection_name= server2
141 --source include/rpl_connection.inc
142 SET @@GLOBAL.DEBUG= '-d,group_replication_compatibility_higher_patch_version';
143
144 --let $rpl_connection_name= server3
145 --source include/rpl_connection.inc
146 SET @@GLOBAL.DEBUG= '-d,group_replication_version_8_0_35';
147
148 --source include/group_replication_end.inc