-
Notifications
You must be signed in to change notification settings - Fork 168
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
Effects of multiple concurrent runs against the same database #377
Comments
Same question |
+1 |
Hello @moredhel ! Yes, running another migrate-mongo before the end of the first migrate-mongo will spin another migration script. Might it lead to a problem ? Since we encountered the same issue, here is what we did : This worked quite well, be we decided to go for another solution though. Which I think is far better but is heavily dependent of our infrastructure, and CI/CD. We decided that an application shouldn't migrate its own data. Another service should do that. That way, we are sure that the scripts are executed 1 and only 1 time. And we are sure that a version always runs with the right related migration script. I hope this helps. |
Hi Dave, We have actually gone for a similar approach to yours.
Which we're pretty happy with at the moment. This PR will still help with the case of multiple parallel CI runs though if they start trying to step on one-another's toes. Thanks again for the PR, it does address the core concern of this issue so we can close it once #262 has been successfully merged. |
Bump @daveboulard Is this still the case with the latest library version? Are we still not supposed to run the library simultaneously from multiple server nodes? I am asking because I was under the impression that Was this approach considered? Or do I misunderstand how the migration library works? BTW, is |
Hi,
We have recently moved to managing our mongo schema with
migrate-mongo
. We are wanting to automate the process of migrating the state though, so plan to have a hands-off process.Our plan is to run the migration in a pre-start script for our service, then to start the service.
Our concern is that if we have N (where N > 2) services trying to do this at the same time what, if any, is the risk that we are taking on & what is the expected behaviour?
Questions
Given: Running migrate-mongo in parallel against the same database
Thanks in Advance.
Hamish
The text was updated successfully, but these errors were encountered: