| 1 |
# Validate that when SOURCE_CONNECTION_AUTO_FAILOVER is enabled and |
| 2 |
# STOP REPLICA IO_THREAD is executed, it stops both the IO Thread |
| 3 |
# and the IO Monitor thread. |
| 4 |
# |
| 5 |
# Test: |
| 6 |
# 0. This test requires two servers |
| 7 |
# 1. Create a replication channel ch1 to replicate from |
| 8 |
# server2 to server1. |
| 9 |
# 2. Stop IO thread. Verify that SQL thread is running. |
| 10 |
# 3. Clean up. |
| 11 |
############################################################################### |
| 12 |
--source include/have_slave_repository_type_table.inc |
| 13 |
--let $rpl_skip_start_slave= 1 |
| 14 |
--source include/master-slave.inc |
| 15 |
|
| 16 |
--echo |
| 17 |
--echo ############################################################ |
| 18 |
--echo # 1. Create a replication channel ch1 to replicate from |
| 19 |
--echo # server2 to server1. |
| 20 |
--let $rpl_connection_name= slave |
| 21 |
--source include/rpl_connection.inc |
| 22 |
|
| 23 |
--replace_result $SERVER_MYPORT_1 SERVER_1_PORT |
| 24 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='root', SOURCE_AUTO_POSITION=1, SOURCE_PORT=$SERVER_MYPORT_1, SOURCE_CONNECT_RETRY=1, SOURCE_RETRY_COUNT=1, SOURCE_CONNECTION_AUTO_FAILOVER=1 FOR CHANNEL 'ch1' |
| 25 |
--let $rpl_channel_name='ch1' |
| 26 |
--source include/start_slave.inc |
| 27 |
|
| 28 |
|
| 29 |
--echo |
| 30 |
--echo ############################################################ |
| 31 |
--echo # 2. Stop IO thread |
| 32 |
--echo # Verify that SQL thread is running |
| 33 |
--echo # It will be allowed. |
| 34 |
--let $rpl_channel_name='ch1' |
| 35 |
--source include/stop_slave_io.inc |
| 36 |
|
| 37 |
--let $assert_text= Verify replica_monitor thread is not running |
| 38 |
--let $assert_cond= "[select count(*) FROM performance_schema.threads where NAME=\"thread/sql/replica_monitor\"]" = 0; |
| 39 |
--source include/assert.inc |
| 40 |
|
| 41 |
--let $assert_text= Verify replica SQL thread is running |
| 42 |
--let $assert_cond= "[select count(*) FROM performance_schema.threads where NAME=\"thread/sql/replica_sql\"]" = 1; |
| 43 |
--source include/assert.inc |
| 44 |
|
| 45 |
|
| 46 |
--echo |
| 47 |
--echo ############################################################ |
| 48 |
--echo # 3. Clean up. |
| 49 |
--let $rpl_channel_name='ch1' |
| 50 |
--source include/stop_slave_sql.inc |
| 51 |
|
| 52 |
--let $rpl_channel_name='ch1' |
| 53 |
--let $rpl_reset_slave_all= 1 |
| 54 |
--let $rpl_multi_source= 1 |
| 55 |
--source include/rpl_reset_slave.inc |
| 56 |
--let $rpl_channel_name= |
| 57 |
--let $rpl_reset_slave_all= |
| 58 |
--let $rpl_multi_source= |
| 59 |
|
| 60 |
--let $rpl_skip_sync = 1 |
| 61 |
--source include/rpl_end.inc |