| 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 |
include/start_and_bootstrap_group_replication.inc |
| 7 |
[connection server2] |
| 8 |
include/start_group_replication.inc |
| 9 |
|
| 10 |
# 1. Enable debug point to block action |
| 11 |
[connection server1] |
| 12 |
SET @@GLOBAL.DEBUG= '+d,group_replication_block_group_action'; |
| 13 |
|
| 14 |
# 2. Execute a switch to single primary mode on server1 |
| 15 |
SELECT group_replication_set_as_primary("MEMBER2_UUID"); |
| 16 |
|
| 17 |
# 3. Execute parallel group action on server2 that must fail |
| 18 |
# due to already one operation is being executed |
| 19 |
[connection server2] |
| 20 |
|
| 21 |
# Execute a set primary that must fail |
| 22 |
SELECT group_replication_set_as_primary("MEMBER2_UUID"); |
| 23 |
ERROR HY000: The function 'group_replication_set_as_primary' failed. There is already a configuration action being executed. Wait for it to finish. |
| 24 |
|
| 25 |
# Selecting itself as primary is a no-op |
| 26 |
SELECT group_replication_set_as_primary("MEMBER1_UUID"); |
| 27 |
group_replication_set_as_primary("MEMBER1_UUID") |
| 28 |
The requested member is already the current group primary. |
| 29 |
|
| 30 |
# Execute a switch to multi primary mode that must fail |
| 31 |
SELECT group_replication_switch_to_multi_primary_mode(); |
| 32 |
ERROR HY000: The function 'group_replication_switch_to_multi_primary_mode' failed. There is already a configuration action being executed. Wait for it to finish. |
| 33 |
|
| 34 |
# Execute a switch to single primary mode that must be no-op. |
| 35 |
SELECT group_replication_switch_to_single_primary_mode("MEMBER2_UUID"); |
| 36 |
group_replication_switch_to_single_primary_mode("MEMBER2_UUID") |
| 37 |
Already in single-primary mode. Did you mean to use group_replication_set_as_primary? |
| 38 |
|
| 39 |
SELECT group_replication_switch_to_single_primary_mode("MEMBER1_UUID"); |
| 40 |
group_replication_switch_to_single_primary_mode("MEMBER1_UUID") |
| 41 |
Already in single-primary mode. Did you mean to use group_replication_set_as_primary? |
| 42 |
|
| 43 |
SELECT group_replication_switch_to_single_primary_mode(); |
| 44 |
group_replication_switch_to_single_primary_mode() |
| 45 |
The group is already on single-primary mode. |
| 46 |
|
| 47 |
# 4. Unlock the blocked action on server1 |
| 48 |
[connection server_1] |
| 49 |
SET DEBUG_SYNC= "now SIGNAL signal.action_continue"; |
| 50 |
[connection server1] |
| 51 |
|
| 52 |
# 5. Resume the action on server1 |
| 53 |
group_replication_set_as_primary("MEMBER2_UUID") |
| 54 |
Primary server switched to: MEMBER2_UUID |
| 55 |
|
| 56 |
# 6. Cleanup |
| 57 |
SET @@GLOBAL.DEBUG= '-d,group_replication_block_group_action'; |
| 58 |
[connection server2] |
| 59 |
set session sql_log_bin=0; |
| 60 |
call mtr.add_suppression("The function 'group_replication_set_as_primary' failed. There is*"); |
| 61 |
call mtr.add_suppression("The function 'group_replication_switch_to_multi_primary_mode' failed. There is*"); |
| 62 |
set session sql_log_bin=1; |
| 63 |
include/group_replication_end.inc |