1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
include/have_replication_observers_example_plugin.inc
include/group_replication.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
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.
[connection server1]
# 1. Load plugin replication observers example on server1
include/install_replication_observers_example.inc
# 2. Disable support to send service
# Adding debug point 'gr_message_service_disable_send' to @@GLOBAL.debug
# 3. Bootstrap group
include/start_and_bootstrap_group_replication.inc
# 4. Load plugin replication observers example on server2
[connection server2]
include/install_replication_observers_example.inc
# 5. Join server2 to the group
include/start_group_replication.inc
# 6. Execute UDF that will transmit tag and message over GR send service
SELECT group_replication_service_message_send("tag", "Server2 sent a message");
group_replication_service_message_send("tag", "Server2 sent a message")
The tag and message was sent to the group.
# 7. On server 1 execute UDF but message won't be sent, service is
# disabled
[connection server1]
SELECT group_replication_service_message_send("tag", "Server1 sent a message");
ERROR HY000: group_replication_service_message_send UDF failed; No send service to propagate message to a group.
# 8. To decrease failure rate on assert_grep we do a transaction with
# AFTER consistency to add some rounds on GCS communication and stop GR on
# server1, which will make it wait for the delivery of new view, and
# that will happen only after delivery of service message. This will
# give some time to server to receive and write it to error log.
SET @@SESSION.group_replication_consistency= 'AFTER';
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY , b INT);
DROP TABLE test.t1;
include/stop_group_replication.inc
# 9. Assert server1 only received message from server 2
include/assert_grep.inc [Server 1 received a message from server 2.]
# 10. Assert server2 received only message from itself
[connection server2]
include/assert_grep.inc [Server 2 received message from itself.]
# 11. Cleanup
include/uninstall_replication_observers_example.inc
[connection server1]
# Removing debug point 'gr_message_service_disable_send' from @@GLOBAL.debug
include/start_group_replication.inc
include/uninstall_replication_observers_example.inc
include/group_replication_end.inc
|