Commit ef5741e
feat(alerting): classify MySQL 1236 max_allowed_packet errors separately (PeerDB-io#4417)
## Problem
MySQL error `1236 (HY000)` (`ER_MASTER_FATAL_ERROR_READING_BINLOG`) is
currently always classified as `NOTIFY_BINLOG_INVALID`. But one common
cause is a single binlog event exceeding the replica's
`max_allowed_packet`:
```
failed in pull records when: MySQL execute error: ERROR 1236 (HY000): log event entry exceeded max_allowed_packet;
Increase max_allowed_packet on source; the first event 'mysql-bin.168301' at 1789438008, ...
```
This is **not** binlog corruption/purge — the mitigation is different
(increase `max_allowed_packet` on the source, resync the affected table,
or exclude oversized blob columns), so it deserves its own error class
and tailored user notification.
## Change
- Add `ErrorNotifyBinlogEventExceededMaxAllowedPacket`
(`NOTIFY_BINLOG_EVENT_EXCEEDED_MAX_ALLOWED_PACKET`, action
`NotifyUser`).
- Inside `case 1236`, sub-classify on the `max_allowed_packet` message
signature; everything else still maps to `NOTIFY_BINLOG_INVALID`.
- Add a unit test covering both the new case and the generic 1236
fallback.
It closes DBI-787.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Ilia Demianenko <ilia.demianenko@clickhouse.com>1 parent 2c82c16 commit ef5741e
2 files changed
Lines changed: 42 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
145 | 148 | | |
146 | 149 | | |
147 | 150 | | |
| |||
746 | 749 | | |
747 | 750 | | |
748 | 751 | | |
749 | | - | |
750 | | - | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
751 | 759 | | |
752 | 760 | | |
753 | 761 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
846 | 846 | | |
847 | 847 | | |
848 | 848 | | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
849 | 881 | | |
850 | 882 | | |
851 | 883 | | |
| |||
0 commit comments