Hacker News new | ask | show | jobs
by pas 2694 days ago
> This is kind of bad when you are doing transactions because the bad statement will taint your transaction and you will need to restart from the beginning.

Why is this bad? Can you handle this on the application side somehow? Even if it just means restarting Rails when the migration has finished.

Or the problem is that you want 0 downtime and 0 UX impact migration?

1 comments

It is bad that you have to write a bunch of extra code in your application to retry on this failure. I guess potentially you could modify the rails framework to automatically retry transactions in this situation and aggressively purge the prepared statement cache but this is really a rails change and not an application change. i don't think it is possible to hook the transaction logic in rails to retry transactions safely from application code.

as you guessed restarting rails does fix the problem but the issue is no zero downtime migrations for migrations that should be trivially safe. ie adding a column