Skip to content

Partial fix for dropped columns blowing up replication #117

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 2 commits into from
Jun 19, 2015

Conversation

vartec
Copy link

@vartec vartec commented Jun 17, 2015

Partial fix for dropped columns blowing up replication when replaying binlog with past events

Mitigates following error:

  File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/binlogstream.py", line 262, in fetchone
    self.__freeze_schema)
  File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/packet.py", line 98, in __init__
    freeze_schema = freeze_schema)
  File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/row_event.py", line 550, in __init__
    column_schema = self.column_schemas[i]
IndexError: list index out of range

This is just a superficial patch. It does not address deeper issue at hand, which is that pymysqlreplication has no good way of handling RowEvents containing columns which have been dropped prior to pymsqlreplication start. The problem is always relying on current version of information_schema even though dealing with events that might be several versions in the past.

… binlog with past events

Mitigates following errror:
  File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/binlogstream.py", line 262, in fetchone
    self.__freeze_schema)
  File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/packet.py", line 98, in __init__
    freeze_schema = freeze_schema)
  File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/row_event.py", line 550, in __init__
    column_schema = self.column_schemas[i]
IndexError: list index out of range

This is just a superficial patch. It does not address deeper issue at hand, which is that pymysqlreplication
has no good way of handling RowEvents containing columns which have been dropped prior to pymsqlreplication
start. The problem is always relying on current version of information_schema even though dealing with events
that might be several versions in the past.
@vartec
Copy link
Author

vartec commented Jun 18, 2015

I've also created issue this and the underlying problem: #118

@julien-duponchelle
Copy link
Owner

Do you think it's possible to write a test for this ? I'm not sure

@vartec
Copy link
Author

vartec commented Jun 18, 2015

@noplay I've added unittest. Verified that it fails on your master.

@julien-duponchelle
Copy link
Owner

Great thanks !

julien-duponchelle added a commit that referenced this pull request Jun 19, 2015
Partial fix for dropped columns blowing up replication
@julien-duponchelle julien-duponchelle merged commit 4f54009 into julien-duponchelle:master Jun 19, 2015
vartec pushed a commit to vartec/python-mysql-replication that referenced this pull request Jun 19, 2015
vartec pushed a commit to vartec/python-mysql-replication that referenced this pull request Jun 19, 2015
vartec pushed a commit to vartec/python-mysql-replication that referenced this pull request Jun 19, 2015
vartec pushed a commit to vartec/python-mysql-replication that referenced this pull request Jun 19, 2015
vartec pushed a commit to vartec/python-mysql-replication that referenced this pull request Jun 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants