| 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/master-slave.inc; |
| 13 |
connect (slave2,127.0.0.1,root,,test,$SLAVE_MYPORT2,); |
| 14 |
|
| 15 |
connection slave2; |
| 16 |
RESET SLAVE; |
| 17 |
--replace_result $MASTER_MYPORT MASTER_PORT |
| 18 |
--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root', master_ssl_verify_server_cert=0 |
| 19 |
START SLAVE IO_THREAD; |
| 20 |
source include/wait_for_slave_io_to_start.inc; |
| 21 |
|
| 22 |
connection master; |
| 23 |
let $show_statement= SHOW SLAVE HOSTS; |
| 24 |
let $field= Server_id; |
| 25 |
# 3 is server_id of slave2. |
| 26 |
let $condition= ='3'; |
| 27 |
source include/wait_show_condition.inc; |
| 28 |
# Make sure that the other slave also had time to register. Otherwise we get |
| 29 |
# occasional spurious failures where server_id=2 is missing from SHOW SLAVE |
| 30 |
# HOSTS, when that slave is much slower to register due to thread scheduling. |
| 31 |
let $condition= ='2'; |
| 32 |
source include/wait_show_condition.inc; |
| 33 |
--replace_column 3 'SLAVE_PORT' |
| 34 |
--replace_result $SLAVE_MYPORT SLAVE_PORT $DEFAULT_MASTER_PORT DEFAULT_PORT |
| 35 |
SHOW SLAVE HOSTS; |
| 36 |
|
| 37 |
connection slave2; |
| 38 |
--source include/stop_slave_io.inc |
| 39 |
|
| 40 |
connection master; |
| 41 |
let $show_statement= SHOW SLAVE HOSTS; |
| 42 |
let $field= Server_id; |
| 43 |
# 3 is server_id of slave2. |
| 44 |
let $condition= <> '3'; |
| 45 |
# All rows of 'SHOW SLAVE HOSTS' are not equal to 3. It mean that master has |
| 46 |
# knew the leave of slave2 and has unregistered it. |
| 47 |
let $wait_for_all= 1; |
| 48 |
source include/wait_show_condition.inc; |
| 49 |
--replace_result $SLAVE_MYPORT SLAVE_PORT |
| 50 |
SHOW SLAVE HOSTS; |
| 51 |
|
| 52 |
--source include/rpl_end.inc |