Debian Codegraph @

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

raw
1 ########################################################################
2 #
3 # This test validate that if a recv subscriber fails, group replication will
4 # change is status to ERROR.
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. Enable debug point that causes a failure on recv subscriber
11 # 4. Execute UDF that will transmit tag and message over GR send service
12 # 5. Assert server2 logged error when failed notification on recv service
13 # 6. Assert server1 received message transmitted by GR message delivery
14 # 7. Assert server2 do not received any message and is read only
15 # 8. Cleanup
16 #
17 ########################################################################
18
19 --source include/have_debug.inc
20 --source include/have_replication_observers_example_plugin.inc
21 --source include/have_group_replication_plugin.inc
22 --source include/group_replication.inc
23
24 --echo
25 --echo # 1. Load plugin replication observers example on server1
26
27 --source include/install_replication_observers_example.inc
28
29 --echo
30 --echo # 2. Load plugin replication observers example on server2
31
32 --let $rpl_connection_name= server2
33 --source include/rpl_connection.inc
34
35 --source include/install_replication_observers_example.inc
36
37 --echo
38 --echo # 3. Enable debug point that causes a failure on recv subscriber
39
40 --let $debug_point= gr_message_service_fail_recv
41 --source include/add_debug_point.inc
42
43 --echo
44 --echo # 4. Execute UDF that will transmit tag and message over GR send service
45
46 SELECT group_replication_service_message_send("tag", "Server2 sent a message");
47
48
49 --let $group_replication_member_state= ERROR
50 --source include/gr_wait_for_member_state.inc
51
52 --echo
53 --echo # 5. Assert server2 logged error when failed notification on recv service
54
55 --let $assert_file= $MYSQLTEST_VARDIR/tmp/gr_message_service_fail_recv.2.err
56 --let $assert_count = 1
57 --let $assert_select = A message sent through the Group Replication message deliver service was not delivered successfully. The server will now leave the group. Try to add the server back to the group and check if the problem persists, or check previous messages in the log for hints of what could be the problem.
58 --let $assert_text = Server 2 logged failure to notify recv service.
59 --source include/assert_grep.inc
60
61 --echo
62 --echo # 6. Assert server1 received message transmitted by GR message delivery
63
64 --let $assert_file= $MYSQLTEST_VARDIR/tmp/gr_message_service_fail_recv.1.err
65 --let $assert_count = 1
66 --let $assert_select = Plugin replication_observers_example reported: 'Service message recv TAG: "tag", TAG_SIZE: 3, MSG: "Server2 sent a message", MSG_SIZE: 22.'
67 --let $assert_text = Server 1 received message from server 2.
68 --source include/assert_grep.inc
69
70 --echo
71 --echo # 7. Assert server2 do not received any message and is read only
72
73 --let $rpl_connection_name= server2
74 --source include/rpl_connection.inc
75
76 --let $assert_file= $MYSQLTEST_VARDIR/tmp/gr_message_service_fail_recv.2.err
77 --let $assert_count = 0
78 --let $assert_select = Plugin replication_observers_example reported: 'Service message recv:*.'
79 --let $assert_text = Server 2 received 0 messages.
80 --source include/assert_grep.inc
81
82 --source include/assert_and_disable_read_only.inc
83
84 --echo
85 --echo # 8. Cleanup
86
87 --let $debug_point= gr_message_service_fail_recv
88 --source include/remove_debug_point.inc
89
90 --source include/uninstall_replication_observers_example.inc
91
92 --let $rpl_connection_name= server1
93 --source include/rpl_connection.inc
94
95 --source include/uninstall_replication_observers_example.inc
96
97 --source include/group_replication_end.inc