Bug #27956 corrupt binlog gives incorrect error message
Submitted: 19 Apr 2007 14:38 Modified: 23 Jun 2007 11:08
Reporter: Niklas Saers Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.1.16 OS:MacOS
Assigned to: Assigned Account CPU Architecture:Any

[19 Apr 2007 14:38] Niklas Saers
Description:
In the error logs I get:

070419 16:14:24 [Note] Slave I/O thread: connected to master 'replicant@10.0.3.2:3306',replication started in log 'bin.000045' at position 664998139
070419 16:14:24 [ERROR] Error reading packet from server: log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master ( server_errno=1236)
070419 16:14:24 [ERROR] Got fatal error 1236: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master' from master when reading data from binary log
070419 16:14:24 [Note] Slave I/O thread exiting, read up to log 'bin.000045', position 664998139

This leaves me trying to tweak max_allowed_packet, when in fact, the error is something completely different. In my case, the binlog was corrupt:

mysqlbinlog --position=664998139 bin.000045
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ERROR: Error in Log_event::read_log_event(): 'read error', data_len: 842674229, event_type: 55
Could not read entry at offset 664998139:Error in log format or read error
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;

mysqlbinlog bin.000045 > text.000045
ERROR: Error in Log_event::read_log_event(): 'read error', data_len: 842674229, event_type: 55
Could not read entry at offset 664998139:Error in log format or read error

How to repeat:
Corrupt the binfile.

Suggested fix:
I have read similar bugreports where it turned out to be a faulty scsi adapter. There should either be a more correct error message or an extra sentence that sais that it may be an I/O problem on the server
[19 Apr 2007 15:26] Sveta Smirnova
Thank you for the report.

Is it possible to upload corrupted binary log to we can examine it?
[2 May 2007 2:13] Michiel Dethmers
I've got the same problem running 5.0.27 on Fedora Core 6

Slaves bail out with

[ERROR] Error reading packet from server: log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master ( server_errno=1236)
[ERROR] Got fatal error 1236: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master' from master when reading data from binary log
[Note] Slave I/O thread exiting, read up to log 'binlog.000180', position 3539020

and mysqlbinlog reports:

mysqlbinlog --start-position 3539020 binlog.000180
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
ERROR: Error in Log_event::read_log_event(): 'Event too big', data_len: 1765487672, event_type: 105
Could not read entry at offset 3539020:Error in log format or read error
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;

I set max_allowed_packet to 1G on both master and slave, but restarting slave doesn't help, which makes sense as 1765487672 is bigger than 1Gb which is the max. 

I can provide the binlog if you want. I set the max binlog size to 5M, so they're quite manageable. Where should I put it?
[19 May 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[23 May 2007 11:08] Sveta Smirnova
Thank you for the feedback, Michiel.

Sorry, missed it early because you status of the report haven't been changed.

Related Bug #25419 seems to be different.

Please upload corrupted binary log file to our ftp server as described in Files tab:

"If the data you need to attach is more than 500KB, you should create a compressed archive of the data and a README file that describes the data with a filename that includes the bug number (example: bug-data-27956.zip), and use FTP to upload the archive to ftp://ftp.mysql.com/pub/mysql/upload/. Once you have uploaded the file, add a comment to this bug to notify us about it. Note: This directory is unlistable, which means that once you have uploaded your file, you will not be able to see it.

All entries become the exclusive editorial property of MySQL, Inc."
[23 Jun 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[3 Jul 2008 7:22] Rene Liere
I have the them Problem.
I discover that the Position isn't korrekt. 
The slave positioned on positioned on 32636759, because
in the master-file are only 32636674 and 32636964.
I change the Position with CHANGE MASTER TO and it runs.

My Problem:
Why get my slave the wrong Position?
[3 Jul 2008 9:09] Sveta Smirnova
Rene,

thank you for the feedback. Your problem is different: original problem was because of corrupted binary log and in your case binary log is correct. Please check if your problem is repeatable with current version 5.1.25 and if yes please open new bug report.