Debian Codegraph @

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

raw
1 ########################################################################
2 #
3 # This test validate that service do not have restriction on size of
4 # message.
5 #
6 # Test:
7 # 0. This test requires two servers with GR
8 # 1. Load plugin replication observers example on server1
9 # 2. Load plugin replication observers example on server2
10 # 3. Create a string with more than 4k characters
11 # 4. On server 1 execute UDF that will transmit tag and a big message
12 # over GR send service
13 # 5. Execute UDF that will transmit a big tag and a message over GR
14 # send service
15 # 6. Execute UDF that will transmit a big tag and a big message over GR
16 # send service
17 # 7. To decrease failure rate on assert_grep we do a transaction with
18 # AFTER consistency to add some rounds on GCS communication and stop GR on
19 # server1, which will make it wait for the delivery of new view, and
20 # that will happen only after delivery of service message. This will
21 # give some time to server to receive and write it to error log.
22 # 8. Assert server1 received all the messages transmitted by GR message
23 # delivery
24 # 9. Assert server2 received all the messages transmitted by GR message
25 # delivery
26 # 10. Cleanup
27 #
28 ########################################################################
29
30 --source include/have_replication_observers_example_plugin.inc
31 --source include/have_group_replication_plugin.inc
32 --source include/group_replication.inc
33
34 --echo
35 --echo # 1. Load plugin replication observers example on server1
36
37 --source include/install_replication_observers_example.inc
38
39 --echo
40 --echo # 2. Load plugin replication observers example on server2
41
42 --let $rpl_connection_name= server2
43 --source include/rpl_connection.inc
44
45 --source include/install_replication_observers_example.inc
46
47 --echo
48 --echo # 3. Create a string with more than 4k characters
49
50 --let $big_string=`SELECT REPEAT('A', 4001)`
51
52 --echo
53 --echo # 4. On server 1 execute UDF that will transmit tag and a big message
54 --echo # over GR send service
55
56 --let $rpl_connection_name= server1
57 --source include/rpl_connection.inc
58
59 --eval SELECT group_replication_service_message_send("tag", "$big_string")
60
61 --echo
62 --echo # 5. Execute UDF that will transmit a big tag and a message over GR
63 --echo # send service
64
65 --eval SELECT group_replication_service_message_send("$big_string", "message")
66
67 --echo
68 --echo # 6. Execute UDF that will transmit a big tag and a big message over GR
69 --echo # send service
70
71 --eval SELECT group_replication_service_message_send("$big_string", "$big_string")
72
73 --echo
74 --echo # 7. To decrease failure rate on assert_grep we do a transaction with
75 --echo # AFTER consistency to add some rounds on GCS communication and stop GR on
76 --echo # server1, which will make it wait for the delivery of new view, and
77 --echo # that will happen only after delivery of service message. This will
78 --echo # give some time to server to receive and write it to error log.
79
80 SET @@SESSION.group_replication_consistency= 'AFTER';
81 CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY , b INT);
82 DROP TABLE test.t1;
83 --source include/stop_group_replication.inc
84
85 --echo
86 --echo # 8. Assert server1 received all the messages transmitted by GR message
87 --echo # delivery
88
89 --let $assert_file= $MYSQLTEST_VARDIR/tmp/gr_message_service_big_message.1.err
90 --let $assert_count = 1
91 --let $assert_select = Plugin replication_observers_example reported: 'Service message recv TAG: "tag", TAG_SIZE: 3, MSG: over 4k bytes, MSG_SIZE: 4001.'
92 --let $assert_text = Server 1 received message from itself.
93 --source include/assert_grep.inc
94
95 --let $assert_file= $MYSQLTEST_VARDIR/tmp/gr_message_service_big_message.1.err
96 --let $assert_count = 1
97 --let $assert_select = Plugin replication_observers_example reported: 'Service message recv TAG: over 4k bytes, TAG_SIZE: 4001, MSG: "message", MSG_SIZE: 7.'
98 --let $assert_text = Server 1 received message from itself.
99 --source include/assert_grep.inc
100
101 --let $assert_file= $MYSQLTEST_VARDIR/tmp/gr_message_service_big_message.1.err
102 --let $assert_count = 1
103 --let $assert_select = Plugin replication_observers_example reported: 'Service message recv TAG: over 4k bytes, TAG_SIZE: 4001, MSG: over 4k bytes, MSG_SIZE: 4001.'
104 --let $assert_text = Server 1 received message from itself.
105 --source include/assert_grep.inc
106
107 --echo
108 --echo # 9. Assert server2 received all the messages transmitted by GR message
109 --echo # delivery
110
111 --let $rpl_connection_name= server2
112 --source include/rpl_connection.inc
113
114 --let $assert_file= $MYSQLTEST_VARDIR/tmp/gr_message_service_big_message.2.err
115 --let $assert_count = 1
116 --let $assert_select = Plugin replication_observers_example reported: 'Service message recv TAG: "tag", TAG_SIZE: 3, MSG: over 4k bytes, MSG_SIZE: 4001.'
117 --let $assert_text = Server 2 received message from server 1.
118 --source include/assert_grep.inc
119
120 --let $assert_file= $MYSQLTEST_VARDIR/tmp/gr_message_service_big_message.2.err
121 --let $assert_count = 1
122 --let $assert_select = Plugin replication_observers_example reported: 'Service message recv TAG: over 4k bytes, TAG_SIZE: 4001, MSG: "message", MSG_SIZE: 7.'
123 --let $assert_text = Server 2 received message from server 1.
124 --source include/assert_grep.inc
125
126 --let $assert_file= $MYSQLTEST_VARDIR/tmp/gr_message_service_big_message.2.err
127 --let $assert_count = 1
128 --let $assert_select = Plugin replication_observers_example reported: 'Service message recv TAG: over 4k bytes, TAG_SIZE: 4001, MSG: over 4k bytes, MSG_SIZE: 4001.'
129 --let $assert_text = Server 2 received message from server 1.
130 --source include/assert_grep.inc
131
132 --echo
133 --echo # 10. Cleanup
134
135 --source include/uninstall_replication_observers_example.inc
136
137 --let $rpl_connection_name= server1
138 --source include/rpl_connection.inc
139
140 --source include/start_group_replication.inc
141
142 --source include/uninstall_replication_observers_example.inc
143
144 --source include/group_replication_end.inc