| 1 |
include/group_replication.inc |
| 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 |
# 1. Bootstrap start GR on server1 (Primary). |
| 9 |
# Start GR on server2 (Secondary). |
| 10 |
[connection server1] |
| 11 |
include/start_and_bootstrap_group_replication.inc |
| 12 |
[connection server2] |
| 13 |
include/start_group_replication.inc |
| 14 |
include/assert.inc [Verify group_replication_primary_member is SERVER_UUID] |
| 15 |
|
| 16 |
############################################################ |
| 17 |
# 2. Create two tables, one with a foreign key |
| 18 |
[connection server1] |
| 19 |
CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, KEY(c2)); |
| 20 |
INSERT INTO t1 VALUES (1,1); |
| 21 |
CREATE TABLE t2 (c1 INT PRIMARY KEY, c2 INT, FOREIGN KEY (c2) REFERENCES t1(c2)); |
| 22 |
include/rpl_sync.inc |
| 23 |
|
| 24 |
############################################################ |
| 25 |
# 3. Set a debug sync before broadcast message to group. |
| 26 |
[connection server1] |
| 27 |
SET @debug_save= @@GLOBAL.DEBUG; |
| 28 |
SET @@GLOBAL.DEBUG='d,group_replication_before_message_broadcast'; |
| 29 |
|
| 30 |
############################################################ |
| 31 |
# 4. Commit transaction T1 that will be blocked before broadcast. |
| 32 |
[connection server_1] |
| 33 |
BEGIN; |
| 34 |
INSERT INTO t2 VALUES (1,1); |
| 35 |
COMMIT; |
| 36 |
|
| 37 |
############################################################ |
| 38 |
# 5. Wait until transaction T1 reaches the |
| 39 |
# group_replication_before_message_broadcast debug sync point. |
| 40 |
[connection server1] |
| 41 |
|
| 42 |
############################################################ |
| 43 |
# 6. Commit transaction T2 that will be blocked before broadcast. |
| 44 |
[connection server_1_1] |
| 45 |
BEGIN; |
| 46 |
INSERT INTO t2 VALUES (2,1); |
| 47 |
COMMIT; |
| 48 |
|
| 49 |
############################################################ |
| 50 |
# 7. Wait until both transactions reach the |
| 51 |
# group_replication_before_message_broadcast debug sync point. |
| 52 |
# Signal both transactions to resume the its path. |
| 53 |
[connection server1] |
| 54 |
SET DEBUG_SYNC='now SIGNAL waiting'; |
| 55 |
SET DEBUG_SYNC='now SIGNAL waiting'; |
| 56 |
SET @@GLOBAL.DEBUG= @debug_save; |
| 57 |
|
| 58 |
############################################################ |
| 59 |
# 8. Fetch outcome of transaction T1. |
| 60 |
[connection server_1] |
| 61 |
|
| 62 |
############################################################ |
| 63 |
# 9. Fetch outcome of transaction T2. |
| 64 |
[connection server_1_1] |
| 65 |
|
| 66 |
############################################################ |
| 67 |
# 10. Check data consistency. |
| 68 |
[connection server1] |
| 69 |
include/rpl_sync.inc |
| 70 |
include/assert.inc [Table t2 contains one row with c1=1] |
| 71 |
include/assert.inc [Table t2 contains one row with c1=2] |
| 72 |
include/diff_tables.inc [server1:test.t1, server2:test.t1] |
| 73 |
include/diff_tables.inc [server1:test.t2, server2:test.t2] |
| 74 |
|
| 75 |
############################################################ |
| 76 |
# 11. Clean up. |
| 77 |
DROP TABLE t2; |
| 78 |
DROP TABLE t1; |
| 79 |
include/group_replication_end.inc |