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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
include/group_replication.inc [rpl_server_count=3]
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]
############################################################
# 01. Create a table on the group.
[connection server1]
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY);
[connection server1]
[connection server2]
[connection server3]
############################################################
# 02. Make server2 and 3 block before send its prepare message.
# This will allow us to deterministically remove it from the
# group while others are waiting for its acknowledge.
# The not acknowledged transaction must rollback on server 2 and 3.
[connection server2]
SET @@GLOBAL.DEBUG= '+d,group_replication_wait_on_supress_message_send_after_applier_prepare';
[connection server3]
SET @@GLOBAL.DEBUG= '+d,group_replication_wait_on_supress_message_send_after_applier_prepare';
############################################################
# 03. Execute T1 on server1.
[connection server1]
INSERT INTO t1 VALUES (1);
############################################################
# 04. Wait until T1 is prepared on server3.
[connection server2]
SET DEBUG_SYNC= "now WAIT_FOR signal.after_supress_message_send_after_applier_prepare_waiting";
[connection server3]
SET DEBUG_SYNC= "now WAIT_FOR signal.after_supress_message_send_after_applier_prepare_waiting";
############################################################
# 05. Crash server 2 and 3.
# Their state on server1 will be UNREACHABLE and the group
# will loose the majority.
[connection server2]
[connection server3]
[connection server_1]
include/gr_wait_for_member_state.inc
include/gr_wait_for_member_state.inc
############################################################
# 06. server1 is waiting for the acknowledges, it will not
# proceed until the group majority is reestablished.
[connection server_1]
############################################################
# 07. Unblock the group by forcing its membership to be only
# server1.
SET GLOBAL group_replication_force_members= "MEMBER1_LOCAL_ADDRESS";
############################################################
# 08. T1 did complete on server1.
[connection server1]
include/assert.inc ['There is 1 value in table t1']
############################################################
# 09. T1 did not complete on server 2 and 3.
[connection server_2]
include/rpl_reconnect.inc
include/assert.inc ['There are no values in table t1']
[connection server_3]
include/rpl_reconnect.inc
include/assert.inc ['There are no values in table t1']
############################################################
# 10. Clean up.
[connection server1]
DROP TABLE t1;
[connection server_2]
DROP TABLE t1;
[connection server_3]
DROP TABLE t1;
include/group_replication_end.inc
|