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
|
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. Deploy a group in single-primary mode.
# Server1(primary) and server2(secondary).
# Create and start asynchronous connection with server3 as source and server1 as replica.
[connection server1]
set session sql_log_bin=0;
call mtr.add_suppression("The function 'group_replication_set_as_primary' failed. There is a replica channel running in the group's current primary member.");
set session sql_log_bin=1;
include/start_and_bootstrap_group_replication.inc
CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='root', SOURCE_AUTO_POSITION=1, SOURCE_PORT=SERVER_3_PORT FOR CHANNEL 'gr_channel';
Warnings:
Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
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.
include/start_slave.inc [FOR CHANNEL 'gr_channel']
[connection server2]
set session sql_log_bin=0;
call mtr.add_suppression("The function 'group_replication_set_as_primary' failed. There is a replica channel running in the group's current primary member.");
set session sql_log_bin=1;
include/start_group_replication.inc
# 2. Create table t1 on server3 for later operations.
[connection server3]
CREATE TABLE t1(c1 int primary key);
include/rpl_sync.inc
# 3. Block all transactions on server1.
# Create a new transaction on server3.
# Initiate a change of primary on server1, it fails due to slave channel on server1.
# Unblock all transactions on server1.
[connection server1]
SET @@GLOBAL.DEBUG= '+d,group_replication_wait_on_observer_trans';
[connection server3]
INSERT INTO t1 values(1);
[connection server1]
SET DEBUG_SYNC= "now wait_for signal.group_replication_wait_on_observer_trans_waiting";
SET @@GLOBAL.DEBUG= '-d,group_replication_wait_on_observer_trans';
SELECT group_replication_set_as_primary("SERVER2_UUID", 0);;
ERROR HY000: The function 'group_replication_set_as_primary' failed. There is a replica channel running in the group's current primary member.
[connection server1]
SET DEBUG_SYNC= "now SIGNAL signal.group_replication_wait_on_observer_trans_continue";
include/gr_assert_primary_member.inc
[connection server2]
include/gr_assert_secondary_member.inc
# 4. Block all transactions on server1.
# Create a new transaction on server3.
# Initiate a change of primary on server2, it fails due to slave channel on server1.
# Unblock all transactions on server1.
[connection server1]
SET @@GLOBAL.DEBUG= '+d,group_replication_wait_on_observer_trans';
[connection server3]
INSERT INTO t1 values(2);
[connection server1]
SET DEBUG_SYNC= "now WAIT_FOR signal.group_replication_wait_on_observer_trans_waiting";
[connection server2]
SELECT group_replication_set_as_primary("SERVER2_UUID", 0);;
ERROR HY000: The function 'group_replication_set_as_primary' failed. There is a replica channel running in the group's current primary member.
[connection server1]
SET DEBUG_SYNC= "now SIGNAL signal.group_replication_wait_on_observer_trans_continue";
SET @@GLOBAL.DEBUG= '-d,group_replication_wait_on_observer_trans';
include/gr_assert_primary_member.inc
[connection server2]
include/gr_assert_secondary_member.inc
# 5. Clean up.
[connection server3]
DROP TABLE t1;
include/rpl_sync.inc
[connection server1]
include/stop_slave.inc [FOR CHANNEL 'gr_channel']
include/rpl_reset_slave.inc
include/group_replication_end.inc
|