Debian Codegraph @

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

raw
1 include/have_replication_observers_example_plugin.inc
2 include/group_replication.inc
3 Warnings:
4 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
5 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.
6 [connection server1]
7
8 [connection server2]
9 include/install_replication_observers_example.inc
10 include/start_and_bootstrap_group_replication.inc
11 CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY , b INT);
12 [connection server1]
13 include/install_replication_observers_example.inc
14
15 # 1. Server can't use send service when server status is OFFLINE
16
17 # 1.1. Service send isn't registered when status is OFFLINE
18 SELECT group_replication_service_message_send("tag", "Server1 sent a message when OFFLINE");
19 ERROR HY000: group_replication_service_message_send UDF failed; No send service to propagate message to a group.
20
21 # 1.2. Send message on server2 that won't be received by server1
22 [connection server2]
23 SELECT group_replication_service_message_send("tag", "Server2 sent a message when server1 was OFFLINE");
24 group_replication_service_message_send("tag", "Server2 sent a message when server1 was OFFLINE")
25 The tag and message was sent to the group.
26
27 # 2. Server can use send service when server status is RECOVERING
28
29 # 2.1. Force server1 to stay in RECOVERING status
30 [connection server1]
31 SET @@GLOBAL.DEBUG='+d,recovery_thread_wait_before_finish';
32
33 # 2.2. Start GR on server 1 and wait status is RECOVERING
34 [connection server1]
35 include/start_group_replication.inc
36
37 # 2.3. Server1 shall be able to send messages when status is RECOVERING
38 SELECT group_replication_service_message_send("tag", "Server1 sent a message when RECOVERING");
39 group_replication_service_message_send("tag", "Server1 sent a message when RECOVERING")
40 The tag and message was sent to the group.
41
42 # 2.4. Send message on server2 that shall be received by server1
43 [connection server2]
44 SELECT group_replication_service_message_send("tag", "Server2 sent a message when server1 was RECOVERING");
45 group_replication_service_message_send("tag", "Server2 sent a message when server1 was RECOVERING")
46 The tag and message was sent to the group.
47
48 # 3. Server can use send service when server status is ONLINE
49
50 # 3.1. Allow server1 to finish recovery
51 [connection server1]
52 SET DEBUG_SYNC= "now WAIT_FOR signal.recovery_thread_wait_before_finish_reached";
53 SET @@GLOBAL.DEBUG='-d,recovery_thread_wait_before_finish';
54 SET DEBUG_SYNC= "now SIGNAL signal.recovery_end";
55
56 # 3.2. Wait server1 change is status to ONLINE
57 [connection server1]
58 include/gr_wait_for_member_state.inc
59 SET DEBUG_SYNC= 'RESET';
60
61 # 3.3. Server1 shall be able to send messages when status is ONLINE
62 SELECT group_replication_service_message_send("tag", "Server1 sent a message when ONLINE");
63 group_replication_service_message_send("tag", "Server1 sent a message when ONLINE")
64 The tag and message was sent to the group.
65
66 # 3.4. Send message on server2 that shall be received by server1
67 [connection server2]
68 SELECT group_replication_service_message_send("tag", "Server2 sent a message when server1 was ONLINE");
69 group_replication_service_message_send("tag", "Server2 sent a message when server1 was ONLINE")
70 The tag and message was sent to the group.
71
72 # 4. Server can't use send service when server status is ERROR
73
74 # 4.1. Insert data on server1 that won't be transmitted to the group
75 [connection server1]
76 set session sql_log_bin=0;
77 INSERT INTO test.t1 (a, b) VALUES (1, 1);
78 set session sql_log_bin=1;
79
80 # 4.2. On server2 insert same data of server1 to create a conflict
81 [connection server2]
82 INSERT INTO test.t1 (a, b) VALUES (1, 1);
83
84 # 4.3. Server1 set its status to ERROR server due to a data conflict
85 # with group
86 [connection server1]
87 include/gr_wait_for_member_state.inc
88
89 # 4.4. Server1 return error when trying to use service send
90 SELECT group_replication_service_message_send("tag", "Server1 sent a message when ERROR");
91 ERROR HY000: group_replication_service_message_send UDF failed; Service failed sending message to the group.
92
93 # 4.5. Send message by server2 that won't be received by server1
94 [connection server2]
95 SELECT group_replication_service_message_send("tag", "Server2 sent a message when server1 was ERROR");
96 group_replication_service_message_send("tag", "Server2 sent a message when server1 was ERROR")
97 The tag and message was sent to the group.
98
99 # 5. When group looses quorum server can send messages but they only be
100 # deliver if quorum is reestablished
101
102 # 5.1. Stop server1 and remove table t1 and reset master to allow
103 # joining back to the group
104 [connection server1]
105 include/stop_group_replication.inc
106 DROP TABLE t1;
107 RESET MASTER;
108
109 # 5.2. Start server1 and wait to be ONLINE
110 include/start_group_replication.inc
111
112 # 5.3. Kill server2
113 [connection server2]
114 # Kill and restart:--group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS --group_replication_group_name=GROUP_REPLICATION_GROUP_NAME
115 include/rpl_reconnect.inc
116
117 # 5.4. Server 1 will update server2 status to UNREACHABLE
118 [connection server1]
119
120 # 5.5. Send message on server1, it will be delivered if quorum is achieved
121 SELECT group_replication_service_message_send("tag", "Server1 sent a message without QUORUM");
122 group_replication_service_message_send("tag", "Server1 sent a message without QUORUM")
123 The tag and message was sent to the group.
124
125 # 6. Assert messages received on group delivery message service
126
127 # 6.1. To decrease failure rate on assert_grep we do a transaction with
128 # AFTER consistency to add some rounds on GCS communication and
129 # stop GR on server1, which will make it wait for the delivery of
130 # new view, and that will happen only after delivery of service
131 # message. This will give some time to server to receive and write
132 # it to error log.
133 [connection server2]
134 SET @@SESSION.group_replication_consistency= 'AFTER';
135 INSERT INTO test.t1 (a, b) VALUES (3, 3);
136 [connection server1]
137 include/stop_group_replication.inc
138
139 # 6.2. When OFFLINE server1 didn't send or receive any message
140 include/assert_grep.inc [Server1 did not receive any message when OFFLINE.]
141 include/assert_grep.inc [Server2 receive a message from itself when server1 was OFFLINE.]
142
143 # 6.3. When RECOVERING server1 shall send and receive all messages
144 include/assert_grep.inc [Server1 receive a message from itself and one from server2 when RECOVERING.]
145 include/assert_grep.inc [Server2 receive a message from itself and from server1.]
146
147 # 6.4. When ONLINE server1 shall send and receive all messages
148 include/assert_grep.inc [Server1 receive a message from itself and one from server2 when ONLINE.]
149 include/assert_grep.inc [Server2 receive a message from itself and from server1.]
150
151 # 6.5. When ERROR server1 didn't send or receive any message
152 include/assert_grep.inc [Server1 did not receive any message when ERROR.]
153 include/assert_grep.inc [Server2 receive a message from itself when server1 was ERROR.]
154
155 # 6.6. No messages are received when loss of quorum occur
156 include/assert_grep.inc [Server1 did not receive any message when group loss quorum.]
157 include/assert_grep.inc [Server2 did not receive any message when group loss quorum.]
158
159 # 7. Cleanup
160 [connection server2]
161 DROP TABLE t1;
162 include/uninstall_replication_observers_example.inc
163 [connection server1]
164 include/uninstall_replication_observers_example.inc
165 set session sql_log_bin=0;
166 call mtr.add_suppression("Could not execute Write_rows event on table test.t1; Duplicate entry '1'.*");
167 call mtr.add_suppression("Plugin group_replication reported: 'The applier thread execution was aborted. Unable to process more transactions, this member will now leave the group.'");
168 call mtr.add_suppression("Plugin group_replication reported: 'Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.'");
169 call mtr.add_suppression("Plugin group_replication reported: 'The server was automatically set into read only mode after an error was detected.'");
170 call mtr.add_suppression("Plugin group_replication reported: 'Skipping leave operation: concurrent attempt to leave the group is on-going.'");
171 call mtr.add_suppression("Plugin group_replication reported: '\\[GCS\\] Timeout while waiting for the group communication engine to exit!'");
172 call mtr.add_suppression("Plugin group_replication reported: '\\[GCS\\] The member has failed to gracefully leave the group.'");
173 call mtr.add_suppression("Replica SQL for channel 'group_replication_applier': ... The replica coordinator and worker threads are stopped,*");
174 set session sql_log_bin=1;
175 set session sql_log_bin=0;
176 DROP TABLE t1;
177 set session sql_log_bin=1;
178 include/group_replication_end.inc