| 1 |
include/group_replication.inc [rpl_server_count=3] |
| 2 |
Warnings: |
| 3 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 |
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. |
| 5 |
[connection server1] |
| 6 |
|
| 7 |
############################################################ |
| 8 |
# 01. Create a table on the group. |
| 9 |
[connection server1] |
| 10 |
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY); |
| 11 |
|
| 12 |
############################################################ |
| 13 |
# 02. Make server3 block before send its prepare message. |
| 14 |
[connection server3] |
| 15 |
SET @@GLOBAL.DEBUG= '+d,group_replication_wait_before_message_send_after_applier_prepare'; |
| 16 |
|
| 17 |
############################################################ |
| 18 |
# 03. Execute T1 on server1. |
| 19 |
[connection server1] |
| 20 |
INSERT INTO t1 VALUES (1); |
| 21 |
|
| 22 |
############################################################ |
| 23 |
# 04. Wait until T1 is prepared on server3. |
| 24 |
[connection server3] |
| 25 |
SET DEBUG_SYNC= "now WAIT_FOR signal.after_before_message_send_after_applier_prepare_waiting"; |
| 26 |
|
| 27 |
############################################################ |
| 28 |
# 05. Change group mode to single primary, with server1 as |
| 29 |
# primary. |
| 30 |
[connection server_3] |
| 31 |
SELECT group_replication_switch_to_single_primary_mode("MEMBER1_UUID"); |
| 32 |
[connection server3] |
| 33 |
|
| 34 |
############################################################ |
| 35 |
# 06. Make server3 do send its prepare message. |
| 36 |
[connection server3] |
| 37 |
SET DEBUG_SYNC= 'now SIGNAL signal.after_before_message_send_after_applier_prepare_continue'; |
| 38 |
SET @@GLOBAL.DEBUG= '-d,group_replication_wait_before_message_send_after_applier_prepare'; |
| 39 |
|
| 40 |
############################################################ |
| 41 |
# 07. Get outcome of the group mode change. |
| 42 |
[connection server_3] |
| 43 |
group_replication_switch_to_single_primary_mode("MEMBER1_UUID") |
| 44 |
Mode switched to single-primary successfully. |
| 45 |
include/gr_assert_secondary_member.inc |
| 46 |
[connection server_1] |
| 47 |
include/gr_assert_primary_member.inc |
| 48 |
[connection server2] |
| 49 |
include/gr_assert_secondary_member.inc |
| 50 |
|
| 51 |
############################################################ |
| 52 |
# 08. Validate data. |
| 53 |
[connection server1] |
| 54 |
include/assert.inc ['There is a 1 value in table t1'] |
| 55 |
[connection server2] |
| 56 |
include/assert.inc ['There is a 1 value in table t1'] |
| 57 |
[connection server3] |
| 58 |
include/assert.inc ['There is a 1 value in table t1'] |
| 59 |
include/diff_tables.inc [server1:t1, server2:t1, server3:t1] |
| 60 |
|
| 61 |
############################################################ |
| 62 |
# 09. Clean up. |
| 63 |
[connection server1] |
| 64 |
DROP TABLE t1; |
| 65 |
include/group_replication_end.inc |