How to avoid timing problems when running db:migrate on multiple nodes

22 views
Skip to first unread message

Ofer Nave

unread,
Jan 15, 2015, 1:31:47 PM1/15/15
to capis...@googlegroups.com
I've skimmed half a dozen tutorials on using Capistrano to deploy Rails apps to production (including the Deploying Rails book), but I still haven't seen this issue address.  I've written up an explanation and my best proposed solution here:

http://stackoverflow.com/questions/27969490/how-to-avoid-timing-problems-when-running-dbmigrate-on-multiple-nodes

-ofer

Lee Hambley

unread,
Jan 15, 2015, 1:55:39 PM1/15/15
to Capistrano
You shouldn't be having any timing issues, since your migrations (Ruby/Rails) should be run by one, and only one server which connects to the database server(s) to run the migrations there. You don't run the migrations on every Ruby host, and let them race to "win" at committing their changes first.

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/44d451fe-d0c6-4e68-9d3e-5f9b47932da3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ofer Nave

unread,
Jan 16, 2015, 11:27:29 AM1/16/15
to capis...@googlegroups.com
That wasn't at all clear to me from the docs, but with some help from IRC and after digging into the actual code, I finally figured that out.

-ofer

Lee Hambley

unread,
Jan 16, 2015, 3:50:24 PM1/16/15
to Capistrano
The docs for `capistrano/rails` are just the README, perhaps make the contribution you feel was missing, if you have the time and save the next person a little grief :)
Reply all
Reply to author
Forward
0 new messages