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
|
#
# set up masters server_1 and server_3 with server_2 being a slave.
#.
include/rpl_init.inc [topology=1->2,3->2]
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.
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 server_2]
#
# 1. Test ER_REPLICA_MULTIPLE_CHANNELS_CMD
#
CHANGE REPLICATION SOURCE TO SOURCE_USER = "root";
ERROR HY000: Multiple channels exist on the replica. Please provide channel name as an argument.
SHOW RELAYLOG EVENTS;
ERROR HY000: Multiple channels exist on the replica. Please provide channel name as an argument.
SELECT SOURCE_POS_WAIT("dummy-bin.000001", 4);
ERROR HY000: Multiple channels exist on the replica. Please provide channel name as an argument.
START SLAVE UNTIL SOURCE_LOG_FILE = "dummy-bin.0000001", SOURCE_LOG_POS = 1729
#--error ER_REPLICA_MULTIPLE_CHANNELS_CMD
#SELECT WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS("1111-1111-1111-1111:1");
ERROR HY000: Multiple channels exist on the replica. Please provide channel name as an argument.
START SLAVE UNTIL SOURCE_LOG_FILE = "dummy-bin.000001", SOURCE_LOG_POS = 4;
ERROR HY000: Multiple channels exist on the replica. Please provide channel name as an argument.
#
# 2. Test errors of commands on an invalid channel
#
START SLAVE FOR CHANNEL "non_existent";
ERROR HY000: Replica channel 'non_existent' does not exist.
STOP SLAVE FOR CHANNEL "non_existent";
ERROR HY000: Replica channel 'non_existent' does not exist.
SHOW RELAYLOG EVENTS FOR CHANNEL "non_existent";
ERROR HY000: Replica channel 'non_existent' does not exist.
RESET SLAVE FOR CHANNEL "non_existent";
ERROR HY000: Replica channel 'non_existent' does not exist.
FLUSH RELAY LOGS FOR CHANNEL "non_existent";
ERROR HY000: Replica channel 'non_existent' does not exist.
# Following wait functions shall return for a non_existnent channels
SELECT SOURCE_POS_WAIT("dummy-bin.00001",4, 3, "non_existtent");
SOURCE_POS_WAIT("dummy-bin.00001",4, 3, "non_existtent")
NULL
SELECT WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS("1111-1111-1111-1111:1", 2, "non_existent");
WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS("1111-1111-1111-1111:1", 2, "non_existent")
NULL
Warnings:
Warning 1287 'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS' is deprecated and will be removed in a future release. Please use WAIT_FOR_EXECUTED_GTID_SET instead
#
# 3a) Test that proper error messages are sent out when invalid
# channel names are given for change master command.
#
CHANGE REPLICATION SOURCE TO SOURCE_HOST = "127.0.0.1", SOURCE_USER = "root" FOR CHANNEL "A123456789A123456789A123456789A123456789A123456789A123456789A123456789";
ERROR HY000: Couldn't create channel: Channel name is either invalid or too long.
CHANGE REPLICATION SOURCE TO SOURCE_HOST = "127.0.0.1", SOURCE_USER = "root" FOR CHANNEL " ";
ERROR HY000: Couldn't create channel: Channel name is either invalid or too long.
#
# 3.b) Check that maximum channels permitted error is issued.
#
# Adding debug point 'max_replication_channels_exceeded' to @@GLOBAL.debug
CHANGE REPLICATION SOURCE TO SOURCE_LOG_POS = 4 FOR CHANNEL "257th_channel";
ERROR HY000: Maximum number of replication channels allowed exceeded.
# Removing debug point 'max_replication_channels_exceeded' from @@GLOBAL.debug
#
# 3.c) Check that restricted channel names cannot be used
#
CHANGE REPLICATION SOURCE TO SOURCE_HOST="localhost", SOURCE_PORT=10 FOR CHANNEL "group_replication_applier";
ERROR HY000: CHANGE REPLICATION SOURCE with the given parameters cannot be performed on channel 'group_replication_applier'.
CHANGE REPLICATION SOURCE TO SOURCE_HOST="localhost", SOURCE_PORT=10 FOR CHANNEL "group_replication_recovery";
ERROR HY000: CHANGE REPLICATION SOURCE with the given parameters cannot be performed on channel 'group_replication_recovery'.
# Assert that channels are not created for failed CHANGE MASTER command.
# and number of channels configured must be 2
include/assert.inc [there shall be only two rows representing 2 channels.]
include/rpl_end.inc
RESET REPLICA ALL FOR CHANNEL 'channel_1';
RESET REPLICA ALL FOR CHANNEL 'channel_3';
|