-
Notifications
You must be signed in to change notification settings - Fork 53
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
Rails 5.2.0 migration fails with departure #31
Comments
Thanks a lot @aqeelvn and Welcome to Departure! 🎉 I just skimmed through your (awesome) description and I'll need to go through your PR some other day. I hope you understand. |
👀 |
@departurerb/core-maintainers Ben, I recall a couple months ago you said that where you work, you were testing Rails 5.2 support? Is there a PR? What is the status of that? |
@wyhaines I'm just getting back to this now after having my attention pulled away for several months on something else. I hope to have something sorted out by the end of the year. |
@aqeelvn @sauloperez @wyhaines @benlangfeld I can confirm this solution works and that @aqeelvn explanation is right, I wasn't able to replicate the issue with the specs, but I've created a dummy rails app with a single migration, and here are two builds:
If someone can guide me into how to replicate this in the gem's test suite I'll do it. Thanks in advance |
Context
Migration with departure in rails 5.2 fails. This PR has tried to add support to 5.2 but a new issue is noticed.
Issue
Here is a sample error log when doing a simple migration with departure:
Reason for failing
This issue is introduced by this rails commit
Comparison with previous rails (5.1.6)
A simplified logic of how migration runs in rails 5.1.6:
connection_1
)connection_1
connection_2
connection_2
In rails 5.2.0 this is slightly changed to:
connection_1
)connection_1
connection_1
Now when migration is run with departure's
percona adapter
, the firstconnection_1
always gets disconnected, becausereconnect_with_percona
does a newestablish_connection
, and the existing default connection (connection_1
) will be disconnected and replaced withpercona_connection
under the sameconnection_specification_name
(which is "primary"). Because rails now re-uses the connection object created before migration, this will raise exception because it was disconnected for percona.Related rails issue:
rails/rails#32622
The text was updated successfully, but these errors were encountered: