Skip to content

fake rotate event check #579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pymysqlreplication/binlogstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,11 @@ def fetchone(self):
if code in MYSQL_EXPECTED_ERROR_CODES:
self._stream_connection.close()
self.__connected_stream = False
logging.WARN(
"""
A pymysql.OperationalError error occurred, Re-request the connection.
"""
)
continue
raise

Expand Down Expand Up @@ -635,7 +640,9 @@ def fetchone(self):
# invalidates all our cached table id to schema mappings. This means we have to load them all
# again for each logfile which is potentially wasted effort but we can't really do much better
# without being broken in restart case
self.table_map = {}
if binlog_event.timestamp != 0:
self.table_map = {}

elif binlog_event.log_pos:
self.log_pos = binlog_event.log_pos

Expand Down
7 changes: 0 additions & 7 deletions pymysqlreplication/row_event.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import logging
import struct
import decimal
import datetime
Expand Down Expand Up @@ -36,12 +35,6 @@ def __init__(self, from_packet, event_size, table_map, ctl_connection, **kwargs)
self.table = self.table_map[self.table_id].table
except KeyError: # If we have filter the corresponding TableMap Event
self._processed = False
logging.log(
logging.WARN,
"""
A pymysql.OperationalError error occurred, causing a fake rotate event and initialization of the table_map
""",
)
return

if self.__only_tables is not None and self.table not in self.__only_tables:
Expand Down