# Got fatal error 1236 from master when reading data from binary log

**URL:** <https://forums.percona.com/t/got-fatal-error-1236-from-master-when-reading-data-from-binary-log/22683>\
**Category:** Percona Server for MySQL 5.7\
**Created:** [June 8, 2023, 6:40pm UTC](https://forums.percona.com/t/got-fatal-error-1236-from-master-when-reading-data-from-binary-log/22683 "2023-06-08T18:40:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisDK](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@ChrisDK](https://forums.percona.com/u/ChrisDK)\
**Post date:** [June 8, 2023, 6:40pm UTC](https://forums.percona.com/t/got-fatal-error-1236-from-master-when-reading-data-from-binary-log/22683/1 "2023-06-08T18:40:15Z")

</div>

Hello.

This is the error I see when running ‘show slave status’.  
Got fatal error 1236 from master when reading data from binary log: ‘log event entry exceeded max\_allowed\_packet; Increase max\_allowed\_packet on master; the first event ‘bin-1.084438’ at 48870187, the last event read from ‘/data2/binlogs/bin-1.084438’ at 123, the last byte read from ‘/directory/binlogs/bin-1.084438’ at 48870206.’

I have 1 master and 2 slaves replicating from it.

I slave has resulted in the error.  
The other slave did not experience this error.

All settings regarding max packet size is the same on ALL nodes:  
mysql\> show global variables like ‘%max\_allowed%’;  
±-------------------------±-----------+  
| Variable\_name | Value |  
±-------------------------±-----------+  
| max\_allowed\_packet | 1073741824 |  
| slave\_max\_allowed\_packet | 1073741824 |  
±-------------------------±-----------+  
2 rows in set (0.00 sec)

The only immediate difference I see is that the mysql server version is slightly different:  
master: Server version: 5.7.36-39-log Percona Server  
slave with NO error: Server version: 5.7.36-39-log Percona Server  
slave with error: Server version: 5.7.39-42-log Percona Server

I see some people suggesting to issue SQL\_SLAVE\_SKIP\_COUNTER on the slave, but I would rather not do this as I would like the slave to remain consistent.

Any ideas out there?

---

<div class="post-metadata">

**Author:** ![Dba1](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dba1/32/24223_2.png) [@Dba1](https://forums.percona.com/u/Dba1)\
**Post date:** [June 8, 2023, 7:27pm UTC](https://forums.percona.com/t/got-fatal-error-1236-from-master-when-reading-data-from-binary-log/22683/2 "2023-06-08T19:27:09Z")

</div>

Well mostly like this could be due some loads on your master server, the packet from the master might be more than max allowed packet.  
Solutions  
Check your conf for max allowed packet in both Slave and master. If it’s low increase in both  
Make sure they both have same values both Slave and master.  
Also, there is a parameter in Slave server called Slave max allowed packet. Please check for this value. If it’s low or at default you can responsibly change it.

Finally try to skip past that binary log if all these dont work. You can always use pt-checksum and pt-table-sync to sync your SLAVE TO MASTER after.  
Pt-table-sync and pt-table-checksums are two fine tools by percona you can’t get it wrong. It’s mature and reliable.  
Please act responsibly always try everything out on your test environments before using in production

---

<div class="post-metadata">

**Author:** ![CTutte](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ctutte/32/1341_2.png) [@CTutte](https://forums.percona.com/u/CTutte)\
**Post date:** [June 9, 2023, 12:37pm UTC](https://forums.percona.com/t/got-fatal-error-1236-from-master-when-reading-data-from-binary-log/22683/3 "2023-06-09T12:37:50Z")

</div>

Did the replica crash recently ?

One possibility is that the binary log entry is corrupted.  
Write down the file/pos for current replication, then forget replication settings (STOP SLAVE: RESET SLAVE ALL:) then set replication again to continue from where it left of

---

<div class="post-metadata">

**Author:** ![ChrisDK](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@ChrisDK](https://forums.percona.com/u/ChrisDK)\
**Post date:** [June 9, 2023, 2:45pm UTC](https://forums.percona.com/t/got-fatal-error-1236-from-master-when-reading-data-from-binary-log/22683/4 "2023-06-09T14:45:39Z")

</div>

Thanks.

I ended up setting a new position, which got us moving again. However, I am going to rebuild the slave as I don’t trust its consistency any more. Unfortunately. I believe this is a Percona bug as it appears the master wrote more than max allowed packets to the binary log.

Regarding the show slave status command. I did see something that appears to be impossible and am looking for some feed back.

At the time of the error the coordinates in the show slave status command seems impossible. Note both IO and SQL threads were in the same binary log file bin-1.084438.

- Master\_Log\_File: bin-1.084438
- Read\_Master\_Log\_Pos: 48870187
- Relay\_Master\_Log\_File: bin-1.084438
- Exec\_Master\_Log\_Pos: 765952106

The exec\_master\_log\_pos is a higher number than read\_master\_log\_pos within the same binary log file. I would think that exec\_master\_log\_pos can never be a higher number when in the same binary log file and at most can be the same number. Unless my logic is wrong it would seem at some point things got really messed up here and the sql thread somehow jumped ahead.

Any thoughts/comments would be welcome. Thanks.
