Skip to content

Commit 1247b36

Browse files
committed
MDEV-22951: rpl.rpl_slave_alias_replica failed in buildbot with wrong result
Problem: ======== rpl.rpl_slave_alias_replica test fails sporadically on build bot as shown below. rpl.rpl_slave_alias_replica 'innodb,stmt' w4 [ fail ] +++ /usr/local/mariadb-10.5.4-linux-x86_64/mysql-test/suite/rpl/r/ rpl_slave_alias_replica.reject 2020-06-12 09:52:25.191267945 +0000 @@ -22,6 +22,7 @@ SHOW REPLICA HOSTS; Server_id Host Port Master_id 2 127.0.0.1 SLAVE_PORT 1 +2 127.0.0.1 SLAVE_PORT 1 Analysis: ======== The SHOW REPLICA HOSTS command reports an additional row for the same server occasionally. This happens because of zombie dump threads on the master. Error log from master also confirms that "A slave with the same server_uuid/server_id as this slave has connected to the master". Since SHOW REPLICA HOSTS goes through the list of dump threads and reports the corresponding hosts,the same host is reported twice. Fix: === Instead of capturing the SHOW REPLICA HOSTS command in result file use wait_show_condition.inc. This will ensure that SHOW REPLICA HOSTS command fetches slave host details.
1 parent e101372 commit 1247b36

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

mysql-test/suite/rpl/r/rpl_slave_alias_replica.result

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ START REPLICA;
1818
include/wait_for_slave_io_to_start.inc
1919
include/wait_for_slave_sql_to_start.inc
2020
connection master;
21+
connection slave;
22+
connection master;
2123
"Command: SHOW SLAVE HOSTS --> SHOW REPLICA HOSTS"
22-
SHOW REPLICA HOSTS;
23-
Server_id Host Port Master_id
24-
2 127.0.0.1 SLAVE_PORT 1
2524
DROP USER 'repl_user';
2625
connection slave;
2726
"Command: SHOW SLAVE IO/SQL THREAD --> SHOW REPLICA IO/SQL THREAD"

mysql-test/suite/rpl/t/rpl_slave_alias_replica.test

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,16 @@ START REPLICA;
4545
--source include/wait_for_slave_io_to_start.inc
4646
--source include/wait_for_slave_sql_to_start.inc
4747

48+
--connection master
49+
--sync_slave_with_master
50+
4851
--connection master
4952
--echo "Command: SHOW SLAVE HOSTS --> SHOW REPLICA HOSTS"
50-
--replace_result $SLAVE_MYPORT SLAVE_PORT
51-
SHOW REPLICA HOSTS;
53+
let $show_statement= SHOW REPLICA HOSTS;
54+
let $field= Server_id;
55+
# Slave's server_id 2
56+
let $condition= ='2';
57+
source include/wait_show_condition.inc;
5258
DROP USER 'repl_user';
5359
--sync_slave_with_master
5460

0 commit comments

Comments
 (0)