Slave "Got fatal error 1236" After Losing Connection to Master While Reading > 4GB Binlog
Last updated on SEPTEMBER 20, 2017
Applies to:MySQL Server - Version 4.0 and later
Information in this document applies to any platform.
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 'mysql-bin.000002' at position 8919699927
[ERROR] Error reading packet from server: bogus data in log event; the first event 'mysql-bin.000002' at 329765335, the last event read from 'mysql-bin.000002' at 329765335, the last byte read from 'mysql-bin.000002' 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 'mysql-bin.000002' at 329765335, the last event read from 'mysql-bin.000002' at 329765335, the last byte read from 'mysql-bin.000002' 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.
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.
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
Million Knowledge Articles and hundreds of Community platforms