| 1 |
######################################################################## |
| 2 |
# |
| 3 |
# Only a member that does support the send service, can send messages. |
| 4 |
# This test simulate a non-supported versions. |
| 5 |
# |
| 6 |
# Test: |
| 7 |
# 0. This test requires two servers |
| 8 |
# 1. Load plugin replication observers example on server1 |
| 9 |
# 2. Disable support to send service |
| 10 |
# 3. Bootstrap group |
| 11 |
# 4. Load plugin replication observers example on server2 |
| 12 |
# 5. Join server2 to the group |
| 13 |
# 6. Execute UDF that will transmit tag and message over GR send service |
| 14 |
# 7. On server 1 execute UDF but message won't be sent, service is |
| 15 |
# disabled |
| 16 |
# 8. To decrease failure rate on assert_grep we do a transaction with |
| 17 |
# AFTER consistency to add some rounds on GCS communication and stop GR on |
| 18 |
# server1, which will make it wait for the delivery of new view, and |
| 19 |
# that will happen only after delivery of service message. This will |
| 20 |
# give some time to server to receive and write it to error log. |
| 21 |
# 9. Assert server1 only received message from server 2 |
| 22 |
# 10. Assert server2 received only message from itself |
| 23 |
# 11. Cleanup |
| 24 |
# |
| 25 |
######################################################################## |
| 26 |
|
| 27 |
--source include/have_debug.inc |
| 28 |
--source include/have_replication_observers_example_plugin.inc |
| 29 |
--source include/have_group_replication_plugin.inc |
| 30 |
--let $rpl_skip_group_replication_start= 1 |
| 31 |
--source include/group_replication.inc |
| 32 |
|
| 33 |
--echo |
| 34 |
--echo # 1. Load plugin replication observers example on server1 |
| 35 |
|
| 36 |
--source include/install_replication_observers_example.inc |
| 37 |
|
| 38 |
--echo |
| 39 |
--echo # 2. Disable support to send service |
| 40 |
|
| 41 |
--let $debug_point= gr_message_service_disable_send |
| 42 |
--source include/add_debug_point.inc |
| 43 |
|
| 44 |
--echo |
| 45 |
--echo # 3. Bootstrap group |
| 46 |
|
| 47 |
--source include/start_and_bootstrap_group_replication.inc |
| 48 |
|
| 49 |
--echo |
| 50 |
--echo # 4. Load plugin replication observers example on server2 |
| 51 |
|
| 52 |
--let $rpl_connection_name= server2 |
| 53 |
--source include/rpl_connection.inc |
| 54 |
|
| 55 |
--source include/install_replication_observers_example.inc |
| 56 |
|
| 57 |
--echo |
| 58 |
--echo # 5. Join server2 to the group |
| 59 |
|
| 60 |
--source include/start_group_replication.inc |
| 61 |
|
| 62 |
--echo |
| 63 |
--echo # 6. Execute UDF that will transmit tag and message over GR send service |
| 64 |
|
| 65 |
SELECT group_replication_service_message_send("tag", "Server2 sent a message"); |
| 66 |
|
| 67 |
--echo |
| 68 |
--echo # 7. On server 1 execute UDF but message won't be sent, service is |
| 69 |
--echo # disabled |
| 70 |
|
| 71 |
--let $rpl_connection_name= server1 |
| 72 |
--source include/rpl_connection.inc |
| 73 |
|
| 74 |
--error ER_UDF_ERROR |
| 75 |
SELECT group_replication_service_message_send("tag", "Server1 sent a message"); |
| 76 |
|
| 77 |
--echo |
| 78 |
--echo # 8. To decrease failure rate on assert_grep we do a transaction with |
| 79 |
--echo # AFTER consistency to add some rounds on GCS communication and stop GR on |
| 80 |
--echo # server1, which will make it wait for the delivery of new view, and |
| 81 |
--echo # that will happen only after delivery of service message. This will |
| 82 |
--echo # give some time to server to receive and write it to error log. |
| 83 |
|
| 84 |
SET @@SESSION.group_replication_consistency= 'AFTER'; |
| 85 |
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY , b INT); |
| 86 |
DROP TABLE test.t1; |
| 87 |
--source include/stop_group_replication.inc |
| 88 |
|
| 89 |
--echo |
| 90 |
--echo # 9. Assert server1 only received message from server 2 |
| 91 |
|
| 92 |
--let $assert_file= $MYSQLTEST_VARDIR/tmp/gr_message_service_disabled_send.1.err |
| 93 |
--let $assert_count = 1 |
| 94 |
--let $assert_select = Plugin replication_observers_example reported: 'Service message recv TAG: "tag", TAG_SIZE: 3, MSG: "Server2 sent a message", MSG_SIZE: 22.' |
| 95 |
--let $assert_text = Server 1 received a message from server 2. |
| 96 |
--source include/assert_grep.inc |
| 97 |
|
| 98 |
--echo |
| 99 |
--echo # 10. Assert server2 received only message from itself |
| 100 |
|
| 101 |
--let $rpl_connection_name= server2 |
| 102 |
--source include/rpl_connection.inc |
| 103 |
|
| 104 |
--let $assert_file= $MYSQLTEST_VARDIR/tmp/gr_message_service_disabled_send.2.err |
| 105 |
--let $assert_count = 1 |
| 106 |
--let $assert_select = Plugin replication_observers_example reported: 'Service message recv TAG: "tag", TAG_SIZE: 3, MSG: "Server2 sent a message", MSG_SIZE: 22.' |
| 107 |
--let $assert_text = Server 2 received message from itself. |
| 108 |
--source include/assert_grep.inc |
| 109 |
|
| 110 |
--echo |
| 111 |
--echo # 11. Cleanup |
| 112 |
|
| 113 |
--source include/uninstall_replication_observers_example.inc |
| 114 |
|
| 115 |
--let $rpl_connection_name= server1 |
| 116 |
--source include/rpl_connection.inc |
| 117 |
|
| 118 |
--let $debug_point= gr_message_service_disable_send |
| 119 |
--source include/remove_debug_point.inc |
| 120 |
|
| 121 |
--source include/start_group_replication.inc |
| 122 |
|
| 123 |
--source include/uninstall_replication_observers_example.inc |
| 124 |
|
| 125 |
--source include/group_replication_end.inc |