← Back to team overview

maria-developers team mailing list archive

258a0fb47b7: MDEV-22951: rpl.rpl_slave_alias_replica failed in buildbot with wrong result

 

revision-id: 258a0fb47b74363d0919d6a18b9b2e67d45d4cf7 (mariadb-10.5.2-490-g258a0fb47b7)
parent(s): d1bb7f9143ceafe9cbdc1e53c4ffd4abe232cb97
author: Sujatha
committer: Sujatha
timestamp: 2020-06-24 15:33:45 +0530
message:

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.

---
 mysql-test/suite/rpl/r/rpl_slave_alias_replica.result |  5 ++---
 mysql-test/suite/rpl/t/rpl_slave_alias_replica.test   | 10 ++++++++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/mysql-test/suite/rpl/r/rpl_slave_alias_replica.result b/mysql-test/suite/rpl/r/rpl_slave_alias_replica.result
index 8262cf8212a..2a49e80075f 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_alias_replica.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_alias_replica.result
@@ -18,10 +18,9 @@ START REPLICA;
 include/wait_for_slave_io_to_start.inc
 include/wait_for_slave_sql_to_start.inc
 connection master;
+connection slave;
+connection master;
 "Command: SHOW SLAVE HOSTS --> SHOW REPLICA HOSTS"
-SHOW REPLICA HOSTS;
-Server_id	Host	Port	Master_id
-2	127.0.0.1	SLAVE_PORT	1
 DROP USER 'repl_user';
 connection slave;
 "Command: SHOW SLAVE IO/SQL THREAD --> SHOW REPLICA IO/SQL THREAD"
diff --git a/mysql-test/suite/rpl/t/rpl_slave_alias_replica.test b/mysql-test/suite/rpl/t/rpl_slave_alias_replica.test
index 8f2cd1a4eb3..324821a325f 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_alias_replica.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_alias_replica.test
@@ -45,10 +45,16 @@ START REPLICA;
 --source include/wait_for_slave_io_to_start.inc
 --source include/wait_for_slave_sql_to_start.inc
 
+--connection master
+--sync_slave_with_master
+
 --connection master
 --echo "Command: SHOW SLAVE HOSTS --> SHOW REPLICA HOSTS"
---replace_result $SLAVE_MYPORT SLAVE_PORT
-SHOW REPLICA HOSTS;
+let $show_statement= SHOW REPLICA HOSTS;
+let $field= Server_id;
+# Slave's server_id 2
+let $condition= ='2';
+source include/wait_show_condition.inc;
 DROP USER 'repl_user';
 --sync_slave_with_master