| 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. Activate debug point that will block the group action when changing |
| 8 |
# to single primary mode |
| 9 |
set session sql_log_bin=0; |
| 10 |
call mtr.add_suppression("A member is joining the group while a group configuration operation 'Change to single primary mode' is running*"); |
| 11 |
call mtr.add_suppression("Can't start SQL THREAD for channel 'ch1' when group replication is running a group configuration operation 'Change to single primary mode'*"); |
| 12 |
call mtr.add_suppression("Can't start IO THREAD for channel 'ch1' when group replication is running a group configuration operation 'Change to single primary mode'*"); |
| 13 |
call mtr.add_suppression("Run function 'thread_start' in plugin 'group_replication' failed"); |
| 14 |
call mtr.add_suppression("Replica I/O for channel 'ch1': Fatal error: Failed to run 'thread_start' hook, Error_code: MY-013117"); |
| 15 |
call mtr.add_suppression("Run function 'applier_start' in plugin 'group_replication' failed"); |
| 16 |
call mtr.add_suppression("Replica SQL for channel 'ch1': Fatal error: Failed to run 'applier_start' hook, Error_code: MY-013117"); |
| 17 |
set session sql_log_bin=1; |
| 18 |
CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='root', SOURCE_AUTO_POSITION=1, SOURCE_PORT=SERVER_2_PORT, SOURCE_CONNECT_RETRY=1, SOURCE_RETRY_COUNT=1 FOR CHANNEL 'ch1'; |
| 19 |
Warnings: |
| 20 |
Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 21 |
Note 1760 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. |
| 22 |
SET @@GLOBAL.DEBUG= '+d,group_replication_block_group_action_stop'; |
| 23 |
include/start_and_bootstrap_group_replication.inc |
| 24 |
[connection server2] |
| 25 |
set session sql_log_bin=0; |
| 26 |
call mtr.add_suppression("A member cannot join the group while a group configuration operation 'Change to single primary mode' is running initiated by *"); |
| 27 |
set session sql_log_bin=1; |
| 28 |
|
| 29 |
# 2. Execute action to change group to single primary mode |
| 30 |
[connection server1] |
| 31 |
SELECT group_replication_switch_to_single_primary_mode("MEMBER1_UUID"); |
| 32 |
[connection server_1] |
| 33 |
|
| 34 |
# 3. START GR on server2. Server2 will go in ERROR state. |
| 35 |
# A new member cannot join group while an action is being executed. |
| 36 |
[connection server2] |
| 37 |
SET GLOBAL group_replication_group_name= 'GROUP_NAME'; |
| 38 |
SET GLOBAL group_replication_enforce_update_everywhere_checks= FALSE; |
| 39 |
SET GLOBAL group_replication_single_primary_mode= TRUE; |
| 40 |
START GROUP_REPLICATION; |
| 41 |
include/rpl_gr_wait_for_number_of_members.inc |
| 42 |
|
| 43 |
# 4. Start replica on server 1. Replica will fail to start. |
| 44 |
# Replica cannot start while an action is being executed. |
| 45 |
[connection server_1] |
| 46 |
START REPLICA FOR CHANNEL 'ch1'; |
| 47 |
include/wait_for_slave_io_error.inc [errno=13117] |
| 48 |
include/wait_for_slave_sql_error.inc [errno=13117] |
| 49 |
|
| 50 |
# 5. Unlock the action on server 1 and reap the result. |
| 51 |
SET @@GLOBAL.DEBUG= '-d,group_replication_block_group_action_stop'; |
| 52 |
SET DEBUG_SYNC= "now SIGNAL signal.action_stop_continue"; |
| 53 |
[connection server1] |
| 54 |
group_replication_switch_to_single_primary_mode("MEMBER1_UUID") |
| 55 |
Mode switched to single-primary successfully. |
| 56 |
|
| 57 |
# 6. Assert messages are present in the logs. |
| 58 |
[connection server1] |
| 59 |
[connection server2] |
| 60 |
|
| 61 |
# 7. Cleanup |
| 62 |
[connection server1] |
| 63 |
RESET REPLICA ALL FOR CHANNEL 'ch1'; |
| 64 |
include/group_replication_end.inc |