Slave "Got fatal error 1236" After Losing Connection to Master While Reading > 4GB Binlog
(Doc ID 2018766.1)
Last updated on MARCH 29, 2020
Applies to:
MySQL Server - Version 4.0 and laterInformation in this document applies to any platform.
Symptoms
Here is how you can identify the scenario. Given the error log snippet:
-----
[ERROR] Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
[Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log '<FILENAME>' at position 8919699927
[ERROR] Error reading packet from server: bogus data in log event; the first event '<FILENAME>' at 329765335, the last event read from '<FILENAME>' at 329765335, the last byte read from '<FILENAME>' at 329765354. ( server_errno=1236)
[ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'bogus data in log event; the first event '<FILENAME>' at 329765335, the last event read from 'mysql-bin.000002' at 329765335, the last byte read from '<FILENAME>' at 329765354.', Error_code: 1236
------
[ERROR] Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)
[Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log '<FILENAME>' at position 8919699927
[ERROR] Error reading packet from server: bogus data in log event; the first event '<FILENAME>' at 329765335, the last event read from '<FILENAME>' at 329765335, the last byte read from '<FILENAME>' at 329765354. ( server_errno=1236)
[ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'bogus data in log event; the first event '<FILENAME>' at 329765335, the last event read from 'mysql-bin.000002' at 329765335, the last byte read from '<FILENAME>' at 329765354.', Error_code: 1236
------
Three artifacts that should be noted:
- Typically see slave lost connection to master. Above was at position 8919699927, for some reason (usually network timeout).
- Slave tries to resume at that position (modulo 4GB) , which is a bogus position, likely in the middle of some other event.
Notice: 8919699927 modulo (1024*1024*1024*4) == 329765335
- Not all slaves will break due to this every time. Therefore it is common that some slaves may be unaffected, such as if they didn't have to reconnect.
Changes
Binary logs on the master are larger than 4GB in size. This often happens after changing the binlog_format from STATEMENT to ROW.
Another change might be some bulk import or other large transactions have started occuring on the master.
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Changes |
Cause |
Solution |
If on MySQL 5.6+ |
Other solutions |
References |