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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
# WL#1697: Multisource replication
#
# Test the error conditions for a command.
#
# 1. When Multiple channels exist and FOR CHANNEL clause
# is not issued, then certain COMMANDS shall fail.
# 2. When a non existent channel is provided as input,
# certain commands shall fail
# 3. CHANGE MASTER errors related to Channel as input.
#
#Skip on group replication runs
--source include/not_group_replication_plugin.inc
--source include/have_binlog_format_mixed.inc
# Test requires master-info-repository=TABLE, relay-log-info-repository=TABLE
--source include/have_slave_repository_type_table.inc
--source include/have_debug.inc
--echo #
--echo # set up masters server_1 and server_3 with server_2 being a slave.
--echo #.
--let $rpl_multi_source= 1
--let $rpl_topology= 1->2,3->2
--source include/rpl_init.inc
# Multisource replication is already setup.
# On slave
--let $rpl_connection_name= server_2
--source include/rpl_connection.inc
--echo #
--echo # 1. Test ER_REPLICA_MULTIPLE_CHANNELS_CMD
--echo #
--error ER_REPLICA_MULTIPLE_CHANNELS_CMD
CHANGE REPLICATION SOURCE TO SOURCE_USER = "root";
--error ER_REPLICA_MULTIPLE_CHANNELS_CMD
SHOW RELAYLOG EVENTS;
--error ER_REPLICA_MULTIPLE_CHANNELS_CMD
SELECT SOURCE_POS_WAIT("dummy-bin.000001", 4);
--error ER_REPLICA_MULTIPLE_CHANNELS_CMD
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 ER_REPLICA_MULTIPLE_CHANNELS_CMD
START SLAVE UNTIL SOURCE_LOG_FILE = "dummy-bin.000001", SOURCE_LOG_POS = 4;
--echo #
--echo # 2. Test errors of commands on an invalid channel
--echo #
--error ER_REPLICA_CHANNEL_DOES_NOT_EXIST
START SLAVE FOR CHANNEL "non_existent";
--error ER_REPLICA_CHANNEL_DOES_NOT_EXIST
STOP SLAVE FOR CHANNEL "non_existent";
--error ER_REPLICA_CHANNEL_DOES_NOT_EXIST
SHOW RELAYLOG EVENTS FOR CHANNEL "non_existent";
--error ER_REPLICA_CHANNEL_DOES_NOT_EXIST
RESET SLAVE FOR CHANNEL "non_existent";
--error ER_REPLICA_CHANNEL_DOES_NOT_EXIST
FLUSH RELAY LOGS FOR CHANNEL "non_existent";
--echo # Following wait functions shall return for a non_existnent channels
SELECT SOURCE_POS_WAIT("dummy-bin.00001",4, 3, "non_existtent");
SELECT WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS("1111-1111-1111-1111:1", 2, "non_existent");
--echo #
--echo # 3a) Test that proper error messages are sent out when invalid
--echo # channel names are given for change master command.
--echo #
--error ER_REPLICA_CHANNEL_NAME_INVALID_OR_TOO_LONG
CHANGE REPLICATION SOURCE TO SOURCE_HOST = "127.0.0.1", SOURCE_USER = "root" FOR CHANNEL "A123456789A123456789A123456789A123456789A123456789A123456789A123456789";
--error ER_REPLICA_CHANNEL_NAME_INVALID_OR_TOO_LONG
CHANGE REPLICATION SOURCE TO SOURCE_HOST = "127.0.0.1", SOURCE_USER = "root" FOR CHANNEL " ";
--echo #
--echo # 3.b) Check that maximum channels permitted error is issued.
--echo #
--let $debug_point= max_replication_channels_exceeded
--source include/add_debug_point.inc
--error ER_REPLICA_MAX_CHANNELS_EXCEEDED
CHANGE REPLICATION SOURCE TO SOURCE_LOG_POS = 4 FOR CHANNEL "257th_channel";
--let $debug_point= max_replication_channels_exceeded
--source include/remove_debug_point.inc
--echo #
--echo # 3.c) Check that restricted channel names cannot be used
--echo #
--error ER_REPLICA_CHANNEL_OPERATION_NOT_ALLOWED
CHANGE REPLICATION SOURCE TO SOURCE_HOST="localhost", SOURCE_PORT=10 FOR CHANNEL "group_replication_applier";
--error ER_REPLICA_CHANNEL_OPERATION_NOT_ALLOWED
CHANGE REPLICATION SOURCE TO SOURCE_HOST="localhost", SOURCE_PORT=10 FOR CHANNEL "group_replication_recovery";
--echo # Assert that channels are not created for failed CHANGE MASTER command.
--echo # and number of channels configured must be 2
--let $assert_text= there shall be only two rows representing 2 channels.
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_applier_configuration] = 2;
--source include/assert.inc
# End MSR setup.
--let $rpl_skip_sync= 1
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc
|