Skip to content
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

Use database lock to prevent migrations from running concurrently #204

Merged
merged 1 commit into from
May 11, 2020

Conversation

slashdotdash
Copy link
Member

Use Postgres advisory lock when migrating an event store database to ensure only a single migration can run at a time. This protects against running migrations concurrently by mistake.

A database lock is used to ensure only one migration can run at a time, preventing issues with multi-node deployments where the migration is automatically run on startup where two or more nodes starting at the same time may attempt to migrate simultaneously.

Fixes #192.

slashdotdash added a commit that referenced this pull request May 11, 2020
Use Postgres advisory lock when migrating an event store database to ensure only a single migration can run at a time. This protects against running migrations concurrently by mistake.

Fixes #192.
@slashdotdash slashdotdash force-pushed the feature/migration-database-lock branch from 20bd1db to af16d87 Compare May 11, 2020 22:46
@slashdotdash slashdotdash self-assigned this May 11, 2020
@slashdotdash slashdotdash merged commit edbf696 into master May 11, 2020
@slashdotdash slashdotdash deleted the feature/migration-database-lock branch May 11, 2020 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use database lock to prevent migrations from running concurrently
1 participant