Skip to content

Add Mutex Lock for Database Migrations #191

@kris-evans

Description

@kris-evans

We currently use Goose migrations as part of our deployments to Kubernetes. We like to deploy our database changes before we deploy our code so we do this as part of the startup sequence for the web service. (e.g. we setup our db connections, run any pending migrations, then bind and start our service).

We run into an issue during deploys where if two pods start up and a migration takes longer than a few seconds, it will cause both migrations to be executed simultaneously which can cause weird state in the database migration process.

Could we please add a lock to the database migrations table that would would make it impossible to accidentally run two migrations simultaneously?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions