-
Notifications
You must be signed in to change notification settings - Fork 280
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
Add lock for concurrent migrations running from several nodes #45
Comments
I'm not sure if @rubenv is considering this, but I personally probably wouldn't merge it in sql-migrate. I think that the problem you're describing is something you should solve on a different layer in your operations process. Either via the process management or deployment tools you use. Even with locking in place, this isn't non-trivial to add and frankly not part of the problem sql-migrate tries to solve. sql-migrate is also a library, so it's probably quite doable to hack your own implementation for your specific MySQL use-case. Just my two cents |
Yup, agreeing with @Dynom here. Let's keep sql-migrate simple. |
@dskarataev I had the same exact need and implemented such functionality in #58. I'm not sure if this is the direction that |
Hi,
could you please add a lock for migrations? Our API runs migrations right before initialization and it's running on more than one node, so we have conflicts because the migrations try to apply at the same time from different nodes. It's ok for CREATE IF NOT EXIST or ALTER but not so good for datafixes like simple INSERT new value.
Please consider to acquire access using GET LOCK or some similar approach, thanks.
http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_get-lock
The text was updated successfully, but these errors were encountered: