| 1 |
############################################################################### |
| 2 |
# Bug#13963 SHOW SLAVE HOSTS is unreliable |
| 3 |
# |
| 4 |
# Slaves only appear in the output of SHOW SLAVE HOSTS when report-host option |
| 5 |
# is set. If an expected slave does not appear in the list, nobody knows |
| 6 |
# whether the slave does not connect or has started without the "report-host" |
| 7 |
# option. |
| 8 |
# |
| 9 |
# Remove the "Rpl_recovery_rank" column from SHOW SLAVE HOSTS, It is not |
| 10 |
# implemented. |
| 11 |
####################################################################### |
| 12 |
--source include/not_group_replication_plugin.inc |
| 13 |
source include/master-slave.inc; |
| 14 |
connect (slave2,127.0.0.1,root,,test,$SLAVE_MYPORT2,); |
| 15 |
|
| 16 |
connection slave2; |
| 17 |
RESET SLAVE; |
| 18 |
--replace_result $MASTER_MYPORT MASTER_PORT |
| 19 |
--replace_column 2 #### |
| 20 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1',SOURCE_PORT=$MASTER_MYPORT,SOURCE_USER='root' |
| 21 |
START SLAVE IO_THREAD; |
| 22 |
source include/wait_for_slave_io_to_start.inc; |
| 23 |
|
| 24 |
connection master; |
| 25 |
let $show_statement= SHOW SLAVE HOSTS; |
| 26 |
let $field= Server_id; |
| 27 |
# 3 is server_id of slave2. |
| 28 |
let $condition= ='3'; |
| 29 |
source include/wait_show_condition.inc; |
| 30 |
--replace_column 3 'SLAVE_PORT' |
| 31 |
--replace_result $SLAVE_MYPORT SLAVE_PORT $DEFAULT_MASTER_PORT DEFAULT_PORT |
| 32 |
--sorted_result |
| 33 |
source include/show_slave_hosts.inc; |
| 34 |
|
| 35 |
connection slave2; |
| 36 |
--source include/stop_slave_io.inc |
| 37 |
|
| 38 |
connection master; |
| 39 |
|
| 40 |
# Run dummy DDL to wake up dump thread and detect the disconnected slave |
| 41 |
CREATE TABLE t1(a int); |
| 42 |
DROP TABLE t1; |
| 43 |
|
| 44 |
let $show_statement= SHOW SLAVE HOSTS; |
| 45 |
let $field= Server_id; |
| 46 |
# 3 is server_id of slave2. |
| 47 |
let $condition= <> '3'; |
| 48 |
# All rows of 'SHOW SLAVE HOSTS' are not equal to 3. It mean that master has |
| 49 |
# knew the leave of slave2 and has unregistered it. |
| 50 |
let $wait_for_all= 1; |
| 51 |
source include/wait_show_condition.inc; |
| 52 |
source include/show_slave_hosts.inc; |
| 53 |
|
| 54 |
--source include/rpl_end.inc |