Bug #40355 RESET MASTER causes slave(s) to hang with no message
Submitted: 27 Oct 2008 18:45 Modified: 27 Oct 2008 18:51
Reporter: Sven Sandberg Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.1+ OS:Any
Assigned to: CPU Architecture:Any
Tags: RESET MASTER

[27 Oct 2008 18:45] Sven Sandberg
Description:
RESET MASTER removes the binlog files without informing any running dump thread(s) about it. That causes running slaves to hang.

How to repeat:
==== BEGIN TEST CASE ====
source include/master-slave.inc;

CREATE TABLE t1 (a INT);

sync_slave_with_master;
connection master;

reset master;
INSERT INTO t1 VALUES (1);

connection slave;
query_vertical SHOW SLAVE STATUS;

connection master;
query_vertical SHOW MASTER STATUS;
sync_slave_with_master;

SELECT * FROM t1;

exit;
==== END TEST CASE ====

The test case fails on the second sync_with_master. The previous call to SHOW SLAVE STATUS shows that Slave_IO_Running = Yes and Slave_SQL_Running = Yes.

Suggested fix:
One of:
 - Document as a (probably unwanted) side effect of running RESET MASTER when there are running slaves.
 - Make the dump threads send some sort of end-of-file message when RESET MASTER is executed.
[27 Oct 2008 20:19] Sven Sandberg
This is not a bug, because RESET MASTER is not supposed to work when there are running slaves.
[27 Oct 2008 20:55] Sven Sandberg
See BUG#40361