mariadb/mysql-test/suite/rpl/r/rpl_slave_alias_replica.result
Sujatha 1247b36bad 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.
2020-06-25 15:11:54 +05:30

55 lines
1.7 KiB
Text

include/master-slave.inc
[connection master]
"Command: STOP SLAVE --> STOP REPLICA"
connection slave;
STOP REPLICA;
include/wait_for_slave_io_to_stop.inc
include/wait_for_slave_sql_to_stop.inc
connection master;
CREATE USER 'repl_user';
"Privilege: SLAVE --> REPLICA"
GRANT REPLICATION REPLICA on *.* TO repl_user;
FLUSH PRIVILEGES;
connection slave;
"SHOW SLAVE STATUS --> SHOW REPLICA STATUS"
CHANGE MASTER TO MASTER_USER= 'repl_user';
"Command: START SLAVE --> START REPLICA"
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"
DROP USER 'repl_user';
connection slave;
"Command: SHOW SLAVE IO/SQL THREAD --> SHOW REPLICA IO/SQL THREAD"
STOP REPLICA IO_THREAD;
STOP REPLICA SQL_THREAD;
include/wait_for_slave_io_to_stop.inc
include/wait_for_slave_sql_to_stop.inc
"Command: RESET SLAVE ALL --> RESET REPLICA ALL"
RESET REPLICA ALL;
connection master;
RESET MASTER;
CREATE TABLE t(f INT) ENGINE=INNODB;
INSERT INTO t VALUES (10);
DROP TABLE t;
connection slave;
CHANGE MASTER TO MASTER_HOST='127.0.0.1',MASTER_PORT=MASTER_PORT,MASTER_USER='root';
"Command: START SLAVE UNTIL --> START REPLICA UNTIL"
START REPLICA UNTIL MASTER_LOG_FILE='MASTER_LOG_FILE', MASTER_LOG_POS=MASTER_POS;
include/wait_for_slave_sql_to_stop.inc
include/stop_slave_io.inc
SELECT * FROM t;
f
10
include/check_slave_param.inc [Exec_Master_Log_Pos]
"MASTER_USE_GTID=SLAVE_POS --> MASTER_USE_GTID=REPLICA_POS"
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT, MASTER_USE_GTID=REPLICA_POS;
include/start_slave.inc
connection master;
CREATE TABLE t2 (f INT PRIMARY KEY) ENGINE=INNODB;
INSERT INTO t2 VALUES (10);
DROP TABLE t2;
include/rpl_end.inc