config root man

Current Path : /home/usr.opt/mysql57/mysql-test/suite/rpl/t/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //home/usr.opt/mysql57/mysql-test/suite/rpl/t/rpl_multi_source_slave_skip_counter.test

# WL#1697: Multisource replication
#
# Test the behaviour when sql_slave_skip_counter is set
#
# BUG#19634753: WL1697: IF SQL_SLAVE_SKIP_COUNTER > 0, IO_THREAD(S) ARE
#               NOT ABLE TO START
# BUG#20400518
# The behavior for MySQL 5.7 should be:
#
# sql_slave_skip_counter can be set at anytime, even some channels are running.
# Setting sql_slave_skip_counter doesn't effect any running channel. Its value
# only effects the first channel starting after the
# 'SET GLOBAL sql_slave_skip_counter'. After the channel starts,
# sql_slave_skip_counter will be reset to 0 automatically.
#
# The process like:
#
# SET GLOBAL sql_slave_skip_counter = 5;
# START SLAVE FOR CHANNEL 'ch1';
#
# SHOW SLAVE STATUS FOR CHANNEL 'channel_1';
# Skip_count item will be 5.
#
# SELECT @@GLOBAL.sql_slave_skip_counter;
# It will be 0.
#
#
# START SLAVE will report the error ER_SLAVE_CHANNEL_SQL_SKIP_COUNTER if it is
# starting more than one channels.
#
#
#Skip on group replication runs
--source include/not_group_replication_plugin.inc
--source include/have_binlog_format_mixed.inc
--source include/not_gtid_enabled.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

# On slave
--let $rpl_connection_name= server_2
--source include/rpl_connection.inc
call mtr.add_suppression("Slave: Could not start slave for channel");

--echo #
--echo # Verify that Setting sql_slave_skip_counter doesn't effect running
--echo # channels
--echo #
SET GLOBAL sql_slave_skip_counter= 1;

--let $skip_counter= query_get_value(SHOW SLAVE STATUS FOR CHANNEL 'channel_1', Skip_Counter, 1)
--let $assert_text= check that channel_1's Skip_Counter is 0.
--echo $skip_counter
--let $assert_cond= $skip_counter=0
--source include/assert.inc

# stop SQL THREAD for all channels
STOP SLAVE SQL_THREAD;
--let $rpl_source_file= include/wait_for_slave_sql_to_stop.inc
--source include/rpl_for_each_connection.inc

--echo #
--echo # Verify that START SLAVE FOR CHANNEL will copy sql_slave_skip_counter's
--echo # value to the channel and reset sql_slave_skip_counter to 0
--echo #

# first stop the channels
--let $rpl_connection_name= server_2
--source include/rpl_connection.inc
--source include/stop_slave.inc

--let $rpl_channel_name= channel_1
--source include/start_slave.inc

--let $skip_counter= query_get_value(SHOW SLAVE STATUS FOR CHANNEL 'channel_1', Skip_Counter, 1)
--let $assert_text= check that channel_1's Skip_Counter is 0.
--echo $skip_counter
--let $assert_cond= $skip_counter= 1
--source include/assert.inc

--let $assert_text= check that sql_slave_skip_counter is 0
--let $assert_cond= @@GLOBAL.sql_slave_skip_counter = 0
--source include/assert.inc

--echo #
--echo # START SLAVE [SQL_THREAD] will fail when sql_slave_skip_counter is 1
--echo # and there are more than one channels
--echo #
SET GLOBAL sql_slave_skip_counter = 1;

--error ER_SLAVE_CHANNEL_SQL_SKIP_COUNTER
START SLAVE;

--error ER_SLAVE_CHANNEL_SQL_SKIP_COUNTER
START SLAVE SQL_THREAD;

--echo #
--echo # START SLAVE IO_THREAD should not fail.
--echo #

--disable_warnings
START SLAVE IO_THREAD;
--enable_warnings
--let $rpl_source_file= include/wait_for_slave_io_to_start.inc
--source include/rpl_for_each_connection.inc

--let $assert_text= All two IO threads are running after START SLAVE IO_THREAD
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_connection_status WHERE Service_State="ON"] = 2;
--source include/assert.inc

SET GLOBAL sql_slave_skip_counter= 0;

# End MSR setup.
--let $rpl_skip_sync= 1
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc

Man Man