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

bug: semaphore for when db migrations are being run #2579

Open
Ardiea opened this issue Jul 31, 2024 · 0 comments
Open

bug: semaphore for when db migrations are being run #2579

Ardiea opened this issue Jul 31, 2024 · 0 comments
Labels
bug Something isn't working product:infrastructure Issues related to application and operations infrastructure project:open-edx

Comments

@Ardiea
Copy link
Member

Ardiea commented Jul 31, 2024

[Unit]
Description="Obtain an exclusive lock and run database migrations at startup."
Requires=network-online.target
After=consul-template.service

[Service]
Type=oneshot
ExecStart=/usr/local/bin/consul lock -timeout=6h -verbose lms_migrations /edx/bin/edxapp-migrate-lms
ExecStart=/usr/local/bin/consul lock -timeout=6h -verbose cms_migrations /edx/bin/edxapp-migrate-cms
RemainAfterExit=True
StandardOutput=journal
StandardError=journal
SyslogIdentifier=migrations
Restart=no

[Install]
WantedBy=multi-user.target

We should only allow database migrations to run one at a time. It is okay for a migration to run again but it isn't okay for them to run simultaneously. We had this simple + neat locking mechanism using consul before but that was lost with moving edxapp into a docker container.

Possible Solution

Additional Details

@Ardiea Ardiea added the bug Something isn't working label Jul 31, 2024
@blarghmatey blarghmatey added product:infrastructure Issues related to application and operations infrastructure project:open-edx labels Aug 2, 2024
@Ardiea Ardiea assigned Ardiea and unassigned Ardiea Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product:infrastructure Issues related to application and operations infrastructure project:open-edx
Projects
None yet
Development

No branches or pull requests

2 participants