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 #192

Closed
slashdotdash opened this issue Mar 16, 2020 · 0 comments · Fixed by #204
Closed

Use database lock to prevent migrations from running concurrently #192

slashdotdash opened this issue Mar 16, 2020 · 0 comments · Fixed by #204
Assignees

Comments

@slashdotdash
Copy link
Member

slashdotdash commented Mar 16, 2020

The mix event_store.migrate task used to migrate an EventStore database is idempotent but does not support being run concurrently.

A database lock could be 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 as two or more nodes starting at the same time may attempt to migrate simultaneously.

@slashdotdash slashdotdash self-assigned this May 11, 2020
slashdotdash added a commit that referenced this issue 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 added a commit that referenced this issue 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.
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 a pull request may close this issue.

1 participant