Debian Codegraph @

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

raw
1 ################################################################################
2 # This test fits two purposes:
3 # - Make sure that P_S tables will report values of the communication stack
4 # that are coherent with the specified design;
5 # - Make sure that we can use mixed values for running variables and connection
6 # protocol in the same group if we follow the upgrade/downgrade design rules.
7 #
8 #
9 # Test:
10 # 0. The test requires two servers: M1 and M2.
11 # 1. Start the group normally.
12 # 2. Assert that the value in group_replication_communication_stack is the
13 # same as the one the in P_S table for incoming connections
14 # 3. Stop both servers and backup the communication stack value, local_address
15 # and seeds
16 # 4. In server 1, change to MySQL stack and adjust the local_address and seeds
17 # accordingly
18 # 5. Start and bootstrap the group with server 1
19 # 6. In server 2, change to MySQL stack and adjust the local_address and seeds
20 # accordingly
21 # 7. Start server 2.
22 # 8. Assert that the value in group_replication_communication_stack is the
23 # same as the one the in P_S table for incoming connections
24 # 9. In server 1, change the protocol to XCom and check that it differs
25 # group_replication_communication_stack
26 # 10. Stop server 1
27 # 11. In server 2, change the protocol to XCom and check that it differs
28 # group_replication_communication_stack
29 # 12. Stop server 2
30 # 13. Bootstrap the group with server 1.
31 # 14. Join Server 2.
32 # 15. Clean up.
33 #
34 ################################################################################
35
36 --echo # 1. Start the group normally.
37 --source include/big_test.inc
38 --source include/have_group_replication_plugin.inc
39 --source include/group_replication.inc
40
41 --echo # 2. Assert that the value in group_replication_communication_stack is the
42 --echo # same as the one the in P_S table for incoming connections
43
44 --let $_rpl_server= 2
45 while ($_rpl_server)
46 {
47 --let $_rpl_connection_name= server$_rpl_server
48 --connection $_rpl_connection_name
49
50 --let $server_uuid= `SELECT @@server_uuid`
51
52 --let $comm_stack_value= `SELECT @@group_replication_communication_stack`
53 --let $incoming_ps_value= `SELECT MEMBER_COMMUNICATION_STACK FROM performance_schema.replication_group_members WHERE MEMBER_ID="$server_uuid"`
54
55 --let $assert_cond= "$comm_stack_value" = "$incoming_ps_value"
56 --let $assert_text= Assert that the configured communication stack is the same as reported in P_S tables
57 --source include/assert.inc
58
59 --dec $_rpl_server
60 }
61
62 --echo # 3. Stop both servers and backup the communication stack value, local_address
63 --echo # and seeds
64 --connection server2
65 --let $communication_stack_save_2= `SELECT @@GLOBAL.group_replication_communication_stack`
66 --let $local_addr_save_2= `SELECT @@GLOBAL.group_replication_local_address`
67 --let $seeds_save_2= `SELECT @@GLOBAL.group_replication_group_seeds`
68 --source include/stop_group_replication.inc
69
70 --let $server_2_uuid= `SELECT @@server_uuid`
71 --let $incoming_ps_value_server2_stopped= `SELECT MEMBER_COMMUNICATION_STACK FROM performance_schema.replication_group_members WHERE MEMBER_ID="$server_2_uuid"`
72 --let $assert_cond= "$communication_stack_save_2" = "$incoming_ps_value_server2_stopped"
73 --let $assert_text= Assert that the configured communication stack remains valid with a stopped server
74 --source include/assert.inc
75
76 --connection server1
77 --let $communication_stack_save_1= `SELECT @@GLOBAL.group_replication_communication_stack`
78 --let $local_addr_save_1= `SELECT @@GLOBAL.group_replication_local_address`
79 --let $seeds_save_1= `SELECT @@GLOBAL.group_replication_group_seeds`
80 --source include/stop_group_replication.inc
81
82 --echo # 4. In server 1, change to MySQL stack and adjust the local_address and seeds
83 --echo # accordingly
84 --echo # 5. Start and bootstrap the group with server 1
85
86 SET GLOBAL group_replication_communication_stack= MySQL;
87 --let $server_address_1= localhost:$SERVER_MYPORT_1
88 --disable_query_log
89 --eval SET GLOBAL group_replication_local_address= "$server_address_1"
90 --eval SET GLOBAL group_replication_group_seeds= "$server_address_1"
91 --enable_query_log
92 --source include/start_and_bootstrap_group_replication.inc
93
94 --echo # 6. In server 2, change to MySQL stack and adjust the local_address and seeds
95 --echo # accordingly
96 --echo # 7. Start server 2.
97 --connection server2
98 SET GLOBAL group_replication_communication_stack= MySQL;
99 --let $server_address_2= localhost:$SERVER_MYPORT_2
100 --disable_query_log
101 --eval SET GLOBAL group_replication_local_address= "$server_address_2"
102 --eval SET GLOBAL group_replication_group_seeds= "$server_address_1"
103 --enable_query_log
104 --source include/start_group_replication.inc
105
106
107 --echo # 8. Assert that the value in group_replication_communication_stack is the
108 --echo # same as the one the in P_S table for incoming connections
109
110 --let $_rpl_server= 2
111 while ($_rpl_server)
112 {
113 --let $_rpl_connection_name= server$_rpl_server
114 --connection $_rpl_connection_name
115
116 --let $server_uuid= `SELECT @@server_uuid`
117
118 --let $comm_stack_value= `SELECT @@group_replication_communication_stack`
119 --let $incoming_ps_value= `SELECT MEMBER_COMMUNICATION_STACK FROM performance_schema.replication_group_members WHERE MEMBER_ID="$server_uuid"`
120
121 --let $assert_cond= "$comm_stack_value" = "$incoming_ps_value"
122 --let $assert_text= Assert that the configured communication stack is the same as reported in P_S tables
123 --source include/assert.inc
124
125 --dec $_rpl_server
126 }
127
128 --echo # 9. In server 1, change the protocol to XCom and check that it differs
129 --echo # group_replication_communication_stack
130 --echo # 10. Stop server 1
131 --connection server1
132 SET GLOBAL group_replication_communication_stack= XCOM;
133
134 --let $server_uuid= `SELECT @@server_uuid`
135
136 --let $comm_stack_value= `SELECT @@group_replication_communication_stack`
137 --let $incoming_ps_value= `SELECT MEMBER_COMMUNICATION_STACK FROM performance_schema.replication_group_members WHERE MEMBER_ID="$server_uuid"`
138
139 --let $assert_cond= "$comm_stack_value" != "$incoming_ps_value"
140 --let $assert_text= Assert that the configured communication stack is different then the one reported in P_S tables
141 --source include/assert.inc
142
143 --source include/stop_group_replication.inc
144
145
146 --echo # 11. In server 2, change the protocol to XCom and check that it differs
147 --echo # group_replication_communication_stack
148 --echo # 12. Stop server 2
149 --connection server2
150 SET GLOBAL group_replication_communication_stack= XCOM;
151
152 --let $server_uuid= `SELECT @@server_uuid`
153
154 --let $comm_stack_value= `SELECT @@group_replication_communication_stack`
155 --let $incoming_ps_value= `SELECT MEMBER_COMMUNICATION_STACK FROM performance_schema.replication_group_members WHERE MEMBER_ID="$server_uuid"`
156
157 --let $assert_cond= "$comm_stack_value" != "$incoming_ps_value"
158 --let $assert_text= Assert that the configured communication stack is different then the one reported in P_S tables
159 --source include/assert.inc
160
161 --source include/stop_group_replication.inc
162
163 --echo # 13. Bootstrap the group with server 1.
164 --connection server1
165 SET GLOBAL group_replication_communication_stack= XCOM;
166 --let $server_address_1= localhost:$SERVER_GR_PORT_1
167 --disable_query_log
168 --eval SET GLOBAL group_replication_local_address= "$server_address_1"
169 --eval SET GLOBAL group_replication_group_seeds= "$server_address_1"
170 --enable_query_log
171 --source include/start_and_bootstrap_group_replication.inc
172
173 --echo # 14. Join Server 2.
174 --connection server2
175 SET GLOBAL group_replication_communication_stack= XCOM;
176 --let $server_address_2= localhost:$SERVER_GR_PORT_2
177 --disable_query_log
178 --eval SET GLOBAL group_replication_local_address= "$server_address_2"
179 --eval SET GLOBAL group_replication_group_seeds= "$server_address_1"
180 --enable_query_log
181 --source include/start_group_replication.inc
182
183 --echo # 15. Clean up.
184
185 --connection server2
186 --disable_query_log
187 --eval SET GLOBAL group_replication_communication_stack= "$communication_stack_save_2"
188 --eval SET GLOBAL group_replication_local_address= "$local_addr_save_2"
189 --eval SET GLOBAL group_replication_group_seeds= "$seeds_save_2"
190 --enable_query_log
191
192 --connection server1
193 --disable_query_log
194 --eval SET GLOBAL group_replication_communication_stack= "$communication_stack_save_1"
195 --eval SET GLOBAL group_replication_local_address= "$local_addr_save_1"
196 --eval SET GLOBAL group_replication_group_seeds= "$seeds_save_1"
197 --enable_query_log
198
199 ## This is the end... My only friend the end!
200 --source include/group_replication_end.inc