Bug #6148 STOP/START SLAVE IO_THREAD gives relay log event parse error
Submitted: 18 Oct 2004 20:17 Modified: 25 Nov 2004 14:16
Reporter: Mikael Fridh Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:4.0.21 OS:Linux (Linux, any?)
Assigned to: Mats Kindahl CPU Architecture:Any

[18 Oct 2004 20:17] Mikael Fridh
Description:
When you start and stop the IO_THREAD the slave will stop replicating with the error:

Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.

Typing STOP SLAVE; followed by START SLAVE; let's replication start again as if nothing happened.

How to repeat:
1. Set up a replicating slave.
2. STOP SLAVE IO_THREAD
3. START SLAVE IO_THREAD

To get replication going again:
STOP SLAVE
START SLAVE
[18 Oct 2004 20:19] Mikael Fridh
A sample mysql session of a recreation of the bug

Attachment: mysql_session_log.txt (text/plain), 3.90 KiB.

[18 Oct 2004 20:21] Mikael Fridh
Worth noting: It _has_ been working in older versions!
[18 Oct 2004 21:01] Guilhem Bichot
From what I am testing now, something indeed looks fishy.
[18 Oct 2004 21:09] Guilhem Bichot
Mikael,
could you please post here the complete error message, I mean including the lines just before "could not parse etc" ?
I was able to get a "could not parse" but it does not mean it's the same problem as yours.
Thanks!
[18 Oct 2004 22:11] Guilhem Bichot
Another question: what was the latest version you had it work fine, please?
[19 Oct 2004 8:41] Guilhem Bichot
For the work of my colleagues, here is a test case (just copy it into mysql-test/t/ into 4.0).
source include/master-slave.inc;
connection slave;
stop slave;
create table t1(n int);
let $1=5000;
disable_query_log;
while ($1)
{
 eval insert into t1 values($1);
 dec $1;
}
enable_query_log;
save_master_pos;

connection slave;
start slave;
sleep 1;
stop slave io_thread;
start slave io_thread;
sync_with_master;

connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;

If you run a debug binary you should get an assertion failure in slave.cc (this will be printed in mysql-test/var/log/slave.err). If you run a non-debug binary you'll get a message in var/log/slave.err saying "could not parse relay log entry" as our user posted here.
[19 Oct 2004 9:18] Mikael Fridh
Guilhem, a quick guess would be that it worked in 4.0.15.