Skip to content
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

ActiveRecord can't insert schema_migrations version due to dropped connection #12

Closed
steverice opened this issue Oct 26, 2015 · 1 comment

Comments

@steverice
Copy link
Collaborator

At the end of a long-running pt-osc migration, this error can occur:

rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: MySQL server has gone away: INSERT INTO `schema_migrations` (`version`) VALUES ('20150622154913') 

ActiveRecord's MySQL connection is likely exceeding the server's wait_timeout and hence its connection gets dropped.
The likely fix is to refresh/re-establish the MySQL connection after pt-osc completes and before inserting the version.

@steverice
Copy link
Collaborator Author

Fixed by #17.

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

No branches or pull requests

1 participant