-
Notifications
You must be signed in to change notification settings - Fork 683
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
Bug: Silently dropping events without errors/logging #483
Comments
@megatron10 what is your mysql Version? If your Mysql version is 8.0, |
The issue is not based on how we extract information from the TableMapEvent. The After this the client gets the actual Row based replication event (WriteRows/UpdateRows/DeleteRows) event, this is where the lookup in the |
@megatron10 |
@megatron10 |
I found a bug in the client. This causes it to drop events from relevant tables and schemas due to handling of rotate events. There is no error logging indicating that an event from a relevant table is being dropped either.
Consider the following usual sequence of binlog file events:
The erroneous library flow:
python-mysql-replication/pymysqlreplication/binlogstream.py
Lines 573 to 595 in a301596
table_map
gets invalidated on every Rotate Event, this causes us to forget the Table Map entry we parsed prior to the connection issue.python-mysql-replication/pymysqlreplication/binlogstream.py
Lines 621 to 633 in a301596
table_map
, this causes a KeyError while constructing the Event object, and the event gets dropped silently, despite being of interest. In the init method of the parent classRowsEvent
, we encounter a KeyError while looking up the table_map, the implementation here marks this event as not to be processed:self._processed = False
.python-mysql-replication/pymysqlreplication/row_event.py
Lines 32 to 38 in a301596
python-mysql-replication/pymysqlreplication/packet.py
Lines 149 to 165 in a301596
python-mysql-replication/pymysqlreplication/binlogstream.py
Lines 634 to 635 in a301596
python-mysql-replication/pymysqlreplication/binlogstream.py
Lines 679 to 684 in a301596
Potential fix strategies:
table_map
, detecting whether the event is an actual rotate or fake rotate seems easy based on the docs.table_map
. I don't completely understand the reason for resetting the table map. We could store the table and schema name in the table_map, and use that while processing the TableMapEvent. After DB restart if the DB remaps the tables to different ids, we would get TableMapEvents for it. Shouldn't these events be enough to fix thetable_map
prior to the Row based events? Why do we need to actually reset thetable_map
?Some other points to note:
The text was updated successfully, but these errors were encountered: