1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
include/group_replication.inc [rpl_server_count=3]
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
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.
[connection server1]
# 1. Multi Primary
# 1.1. On server1 enable group_replication_block_group_action debug
# point
SET @@GLOBAL.DEBUG= '+d,group_replication_block_group_action';
set session sql_log_bin=0;
call mtr.add_suppression("The function 'group_replication_set_as_primary' failed. Primary assigned for election left the group, this operation will be aborted*");
set session sql_log_bin=1;
# 1.2. On server2 execute action to change to single primary with
# server1 as primary
[connection server2]
set session sql_log_bin=0;
call mtr.add_suppression("The function 'group_replication_switch_to_single_primary_mode' failed. Primary assigned for election left the group, this operation will be aborted.");
set session sql_log_bin=1;
SELECT group_replication_switch_to_single_primary_mode("MEMBER1_UUID");
# 1.3. Verify that server2 is checking group pre-conditions
[connection server_2]
include/assert.inc [stage/group_rpl/Single-primary Switch: checking group pre-conditions]
# 1.4. Kill and restart server1
[connection server_1]
# Kill and restart:--group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS --group_replication_group_name=GROUP_REPLICATION_GROUP_NAME
include/rpl_reconnect.inc
# 1.5. Reap action to switch to single primary and it returns error as
# server1 was killed
[connection server2]
ERROR HY000: The function 'group_replication_switch_to_single_primary_mode' failed. Primary assigned for election left the group, this operation will be aborted. No primary election was invoked under this operation.
# 1.6. Add suppression on server3 for action failure
[connection server3]
set session sql_log_bin=0;
call mtr.add_suppression("Error while executing a group configuration operation: Primary assigned for election left the group, this operation will be aborted.");
set session sql_log_bin=1;
# 1.7. Confirm that group replication is on Multi primary server
include/gr_assert_multi_primary_mode.inc
[connection server2]
include/gr_assert_multi_primary_mode.inc
# 1.8. Cleanup to run Single Primary test
[connection server1]
include/start_group_replication.inc
# 2. Single Primary
# 2.1. Execute action to switch to single primary with server1 as
# primary
SELECT group_replication_switch_to_single_primary_mode("MEMBER1_UUID");
group_replication_switch_to_single_primary_mode("MEMBER1_UUID")
Mode switched to single-primary successfully.
# 2.2. Create table on Group Replication
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY , b INT);
# 2.3. Begin a transaction on server1
BEGIN;
INSERT INTO test.t1 (b) VALUES (1);
# 2.4. Execute action to set as primary server2
[connection server_1_1]
SELECT group_replication_set_as_primary("MEMBER2_UUID");
# 2.5. Verify server is waiting for pending transactions to finish in
# order to conclude action
[connection server_1]
include/assert.inc [stage/group_rpl/Primary Switch: waiting for pending transactions to finish]
include/assert.inc [The estimated work is 1]
include/assert.inc [The completed work is 0]
# 2.6. Kill and restart server2, it would be the new primary
[connection server2]
# Kill and restart:--group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS --group_replication_group_name=GROUP_REPLICATION_GROUP_NAME
include/rpl_reconnect.inc
# 2.7. Verify the action executed on server1 failed, server selected
# exited from the group
[connection server_1_1]
ERROR HY000: The function 'group_replication_set_as_primary' failed. Primary assigned for election left the group, this operation will be aborted. No primary election was invoked under this operation.
# 2.8. Assert server1 is the new primary
include/gr_assert_primary_member.inc
# 2.9. Cleanup
[connection server1]
COMMIT;
DROP TABLE t1;
[connection server2]
DROP TABLE t1;
include/group_replication_end.inc
|