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 118 119 120 121 122 123 124 125 126 127 128 129 130
|
################################################################################
# This test intends to prove that group replication channels are not affected
# by START SLAVE and STOP SLAVE commands.
#
# Test:
# 0) The test requires three servers: M1 and M2.
# 1) Bootstrap start a group on M1. Start GR on M2.
# 2) Create a slave channel 'channel_1' on M1 (M3 -> M1). Verify that both slave
# channel and group_replication_applier channel are present on M1.
# 3) With a running slave channel and group replication active do a STOP SLAVE.
# The slave channel should stop but the group replication channel shouldn't.
# 4) With a stopped slave channel and group replication off do a START SLAVE.
# The slave channel should start but the group replication channel shouldn't.
# 5) Restart the server with no automatic plugin start.
# The slave channel should start but the group replication channel shouldn't.
# 6) Clean up.
################################################################################
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--let $rpl_server_count= 3
--source include/group_replication.inc
#
# Phase 1: Start group replication on two servers
#
--connection server1
--echo server1
--source include/start_and_bootstrap_group_replication.inc
--connection server2
--echo server2
--source include/start_group_replication.inc
--connection server1
--let $group_replication_number_of_members= 2
--source include/gr_wait_for_number_of_members.inc
#
# Phase 2: Create a slave channel in server 1 and verify that 2 channels exist
#
--replace_result $SERVER_MYPORT_3 SERVER_3_PORT
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST="127.0.0.1", SOURCE_USER="root", SOURCE_PASSWORD="", SOURCE_PORT=$SERVER_MYPORT_3, SOURCE_AUTO_POSITION=1 FOR CHANNEL "channel_1"
--source include/start_slave.inc
--let $assert_text= 'The group replication applier channel is present'
--let $assert_cond= [SELECT COUNT(*) AS count FROM mysql.slave_relay_log_info WHERE channel_name="group_replication_applier", count, 1] = 1
--source include/assert.inc
--let $assert_text= 'The created slave channel is present'
--let $assert_cond= [SELECT COUNT(*) AS count FROM mysql.slave_relay_log_info WHERE channel_name="channel_1", count, 1] = 1
--source include/assert.inc
#
# Phase 3: Check that after doing a stop slave, the applier channel is still ON
#
--let $assert_text= 'The group replication applier channel is ON'
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_status where CHANNEL_NAME="group_replication_applier" and SERVICE_STATE="ON", count, 1] = 1
--source include/assert.inc
--source include/stop_slave.inc
--let $assert_text= 'The group replication applier channel is still ON'
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_status where CHANNEL_NAME="group_replication_applier" and SERVICE_STATE="ON", count, 1] = 1
--source include/assert.inc
--let $assert_text= 'The created slave channel is OFF'
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_status where CHANNEL_NAME="channel_1" and SERVICE_STATE="OFF", count, 1] = 1
--source include/assert.inc
#
# Phase 4: After being stopped, check that after a START SLAVE the plugin channel is still OFF
#
--source include/stop_group_replication.inc
--let $assert_text= 'The group replication applier channel is OFF'
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_status where CHANNEL_NAME="group_replication_applier" and SERVICE_STATE="OFF", count, 1] = 1
--source include/assert.inc
--source include/start_slave.inc
--let $assert_text= 'The group replication applier channel is still OFF'
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_status where CHANNEL_NAME="group_replication_applier" and SERVICE_STATE="OFF", count, 1] = 1
--source include/assert.inc
--let $assert_text= 'The created slave channel is ON'
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_status where CHANNEL_NAME="channel_1" and SERVICE_STATE="ON", count, 1] = 1
--source include/assert.inc
#
# Phase 5: On restart, only the slave channel should start
#
--connection server1
--let $allow_rpl_inited=1
--source include/restart_mysqld.inc
#Needed as we are not using rpl_restart_server.inc
--let $rpl_server_number= 1
--source include/rpl_reconnect.inc
# Wait for the slave channel start
--let $rpl_channel_name= 'channel_1'
--source include/wait_for_slave_to_start.inc
--let $rpl_channel_name=
--let $assert_text= 'The group replication applier channel is still OFF'
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_status where CHANNEL_NAME="group_replication_applier" and SERVICE_STATE="OFF", count, 1] = 1
--source include/assert.inc
--let $assert_text= 'The created slave channel is ON'
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_status where CHANNEL_NAME="channel_1" and SERVICE_STATE="ON", count, 1] = 1
--source include/assert.inc
#
# Phase 6: Clean the created channels
#
--source include/stop_slave.inc
CHANGE REPLICATION SOURCE TO SOURCE_AUTO_POSITION=0 FOR CHANNEL "channel_1";
--connection server1
--let $skip_restore_connection= 0
--source include/group_replication_end.inc
|