| 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 |
# 1. Start group in single primary mode. |
| 8 |
# Server1 will be primary and server2 secondary. |
| 9 |
[connection server1] |
| 10 |
CREATE TABLE test.t1(c1 int primary key); |
| 11 |
include/start_and_bootstrap_group_replication.inc |
| 12 |
[connection server2] |
| 13 |
include/start_group_replication.inc |
| 14 |
|
| 15 |
# 2. Execute "START TRANSACTION" on server1. |
| 16 |
[connection server1] |
| 17 |
START TRANSACTION; |
| 18 |
|
| 19 |
# 3. Begin change of primary from server2(secondary). |
| 20 |
[connection server2] |
| 21 |
SELECT group_replication_set_as_primary("MEMBER2_UUID",3); |
| 22 |
group_replication_set_as_primary("MEMBER2_UUID",3) |
| 23 |
Primary server switched to: MEMBER2_UUID |
| 24 |
|
| 25 |
# 4. Assert primary changed. |
| 26 |
[connection server2] |
| 27 |
include/gr_assert_primary_member.inc |
| 28 |
[connection server_1] |
| 29 |
include/gr_assert_secondary_member.inc |
| 30 |
|
| 31 |
# 5. Transaction on server1 should fail, since it blocks the UDF. |
| 32 |
# Client connection is dropped. |
| 33 |
[connection server1] |
| 34 |
|
| 35 |
# 6. Execute "START TRANSACTION" on server2. |
| 36 |
[connection server2] |
| 37 |
START TRANSACTION; |
| 38 |
SELECT * FROM test.t1; |
| 39 |
c1 |
| 40 |
|
| 41 |
# 7. Begin change of primary from server2(primary). |
| 42 |
[connection server_2] |
| 43 |
SELECT group_replication_set_as_primary("MEMBER2_UUID",1); |
| 44 |
group_replication_set_as_primary("MEMBER2_UUID",1) |
| 45 |
Primary server switched to: MEMBER2_UUID |
| 46 |
|
| 47 |
# 8. Assert primary changed. |
| 48 |
[connection server1] |
| 49 |
include/gr_assert_primary_member.inc |
| 50 |
[connection server_2] |
| 51 |
include/gr_assert_secondary_member.inc |
| 52 |
|
| 53 |
# 9. Transaction on server2 should fail, since it blocks the UDF. |
| 54 |
# Client connection is dropped. |
| 55 |
[connection server2] |
| 56 |
|
| 57 |
# 10. Execute "BEGIN WORK" on server1. |
| 58 |
[connection server1] |
| 59 |
BEGIN WORK; |
| 60 |
|
| 61 |
# 11. Begin change of primary from server2(secondary). |
| 62 |
[connection server2] |
| 63 |
SELECT group_replication_set_as_primary("MEMBER2_UUID",3); |
| 64 |
group_replication_set_as_primary("MEMBER2_UUID",3) |
| 65 |
Primary server switched to: MEMBER2_UUID |
| 66 |
|
| 67 |
# 12. Assert primary changed. |
| 68 |
[connection server2] |
| 69 |
include/gr_assert_primary_member.inc |
| 70 |
[connection server_1] |
| 71 |
include/gr_assert_secondary_member.inc |
| 72 |
|
| 73 |
# 13. Transaction on server1 should fail, since it blocks the UDF. |
| 74 |
# Client connection is dropped. |
| 75 |
[connection server1] |
| 76 |
|
| 77 |
# 14. Execute "BEGIN WORK" on server2. |
| 78 |
[connection server2] |
| 79 |
BEGIN WORK; |
| 80 |
SELECT * FROM test.t1; |
| 81 |
c1 |
| 82 |
|
| 83 |
# 15. Begin change of primary from server2(primary). |
| 84 |
[connection server_2] |
| 85 |
SELECT group_replication_set_as_primary("MEMBER2_UUID",1); |
| 86 |
group_replication_set_as_primary("MEMBER2_UUID",1) |
| 87 |
Primary server switched to: MEMBER2_UUID |
| 88 |
|
| 89 |
# 16. Assert primary changed. |
| 90 |
[connection server1] |
| 91 |
include/gr_assert_primary_member.inc |
| 92 |
[connection server_2] |
| 93 |
include/gr_assert_secondary_member.inc |
| 94 |
|
| 95 |
# 17. Transaction on server2 should fail, since it blocks the UDF. |
| 96 |
# Client connection is dropped. |
| 97 |
[connection server2] |
| 98 |
|
| 99 |
# 18. Cleanup. |
| 100 |
[connection server1] |
| 101 |
DROP TABLE test.t1; |
| 102 |
include/group_replication_end.inc |