You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the migrate command is killed while a migration is running and the migration succeeds asynchronously inside Postgres, the DB is left marked dirty when in reality it's clean. This is inconsistent, and causes confusion.
This situation realistically occurs when a migration takes longer to run than the app is given to initialize by the supervisor (e.g. Kubernetes) and the supervisor restarts the app.
Does anyone have other ideas on how to enforce the consistency? This won't work for databases that don't support transactions, but perhaps it could be an optional feature that transactional database drivers support.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Describe the Bug
When the
migrate
command is killed while a migration is running and the migration succeeds asynchronously inside Postgres, the DB is left marked dirty when in reality it's clean. This is inconsistent, and causes confusion.This situation realistically occurs when a migration takes longer to run than the app is given to initialize by the supervisor (e.g. Kubernetes) and the supervisor restarts the app.
Steps to Reproduce
Full repro at https://github.com/chrismwendt/golang-migrate-consistency
Expected Behavior
For databases that support transactions/rollback (specifically Postgres), the DB should not be eagerly marked dirty until the migration has failed.
The DB should never be in a state where the migration succeeded but the DB has been marked dirty.
Migrate Version 4.8.0
Loaded Source Drivers file
Loaded Database Drivers postgres, postgresql, stub
Go Version go version go1.13.3 darwin/amd64
Stacktrace N/A
Discussion
Are there any existing issues related to this?
Does anyone have other ideas on how to enforce the consistency? This won't work for databases that don't support transactions, but perhaps it could be an optional feature that transactional database drivers support.
The text was updated successfully, but these errors were encountered: