diff --git a/pymysqlreplication/event.py b/pymysqlreplication/event.py index c47b646e..82b89974 100644 --- a/pymysqlreplication/event.py +++ b/pymysqlreplication/event.py @@ -3,6 +3,7 @@ import datetime import decimal import zlib +import logging from pymysqlreplication.constants.STATUS_VAR_KEY import * from pymysqlreplication.exceptions import StatusVariableMismatch @@ -58,6 +59,11 @@ def _verify_event(self): footer = self.packet.read(4) byte_data = zlib.crc32(data).to_bytes(4, byteorder="little") self._is_event_valid = True if byte_data == footer else False + if not self._is_event_valid: + logging.error( + f"An CRC32 has failed for the event type {self.event_type}, " + "indicating a potential integrity issue with the data." + ) self.packet.read_bytes -= 19 + self.event_size + 4 self.packet.rewind(20)