-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Question: concurrency #464
Comments
Depending on what they going to execute some of them just die while the process is running or if you do something strange in your up or down routine even worse things could happen which could leave you in a broken state. I actually have been asked this some time ago and yes, I am definitely going to add some locking mechanism, which will be especially important for zero downtime stuff. |
Great. Let me know if you need some testing and/or help with the design :) |
Has there been any progress with this? I'd like to use this feature as well. |
@fdw Not yet, work is starting to get traction on some items currently, also looking at this item again right now. |
State manager is in work currently, which will cover this topic as well as some other topics such as atomic actions, crash resistent migrations and ZDC. |
Has there been any progress with this? I'd like to use this feature as well. |
Yes, some progress, in the beta version there is already the state manager, but it does not yet take care of concurrency control. |
tracked in #538 |
Hello,
First of all, thanks for this great library!
I have a concern about how concurrency is handled when executing migrations. What happens if several people (or several scripts) try to run a
db-migrate up
at the same time against the same database? Is there any locking mechanism?This is my usecase: I want to add
db-migrate up
as part of my deployment workflow (inside mynpm run
script) so when I deploy a new version of my app in an environment, new migrations are executed automatically. In environments like heroku, kubernetes and the like, several instances can be started concurrently, so the migration scripts can be launched concurrently. Without a locking mechanism, this can result on the same migrations being executed several times, etc.I know that in Liquibase, for example, uses a separate "lock" table to prevent this kind of problems (see http://www.liquibase.org/documentation/databasechangeloglock_table.html).
I seems to me that there is no equivalent mechanism in db-migrate currently. Am I mistaken? If not, are there any plans for implementing it in the future?
Thanks!
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: