-
Notifications
You must be signed in to change notification settings - Fork 53
Releasing Changelog Locks
When our application comes up, Liquibase will attempt to check for the existence of certain database migrations, and will perform new ones if they have not already been applied. In order to do this, Liquibase must acquire a changelog lock. In essence, all migrations are stored in a specific table in our database; this lock is required to keep multiple Liquibase instances from iterating over the same database.
Unfortunately, if a long-running migration times out, or another issue causes the Java app to crash, Liquibase will not gracefully release the changelog lock. This will result in new application instances spinning up, waiting for 10 minutes to acquire a lock, crashing, and dying. This cycle will continue indefinitely until an engineer manually intervenes.
To verify the presence of a lock, execute the Bastion login procedure. You can find this process in our secure docset.
Once you are logged into the database, run the following query:
select * from public.databasechangeloglock;
You will be met with a response that looks like the following:
id locked lockgranted lockedby
1 TRUE 2021-04-26T22:25:47.304 localhost (127.0.0.1)
To clear the lock, first verify that the application does not hold a legitimate lock. Removing a lock in the middle of an active process may result in data corruption.
Once you have verified that the held lock is orphaned, run the following query to clear it:
update public.databasechangeloglock set locked=false;
- Getting Started
- [Setup] Docker and docker compose development
- [Setup] IntelliJ run configurations
- [Setup] Running DB outside of Docker (optional)
- [Setup] Running nginx locally (optional)
- [Setup] Running outside of docker
- Accessing and testing weird parts of the app on local dev
- Accessing patient experience in local dev
- API Testing with Insomnia
- Cypress
- How to run e2e locally for development
- E2E tests
- Database maintenance
- MailHog
- Running tests
- SendGrid
- Setting up okta
- Sonar
- Storybook and Chromatic
- Twilio
- User roles
- Wiremock
- CSV Uploader
- Log local DB queries
- Code review and PR conventions
- SimpleReport Style Guide
- How to Review and Test Pull Requests for Dependabot
- How to Review and Test Pull Requests with Terraform Changes
- SimpleReport Deployment Process
- Adding a Developer
- Removing a developer
- Non-deterministic test tracker
- Alert Response - When You Know What is Wrong
- What to Do When You Have No Idea What is Wrong
- Main Branch Status
- Maintenance Mode
- Swapping Slots
- Monitoring
- Container Debugging
- Debugging the ReportStream Uploader
- Renew Azure Service Principal Credentials
- Releasing Changelog Locks
- Muting Alerts
- Architectural Decision Records
- Backend Stack Overview
- Frontend Overview
- Cloud Architecture
- Cloud Environments
- Database ERD
- External IDs
- GraphQL Flow
- Hibernate Lazy fetching and nested models
- Identity Verification (Experian)
- Spring Profile Management
- SR Result bulk uploader device validation logic
- Test Metadata and how we store it
- TestOrder vs TestEvent
- ReportStream Integration
- Feature Flag Setup
- FHIR Resources
- FHIR Conversions
- Okta E2E Integration
- Deploy Application Action
- Slack notifications for support escalations
- Creating a New Environment Within a Resource Group
- How to Add and Use Environment Variables in Azure
- Web Application Firewall (WAF) Troubleshooting and Maintenance
- How to Review and Test Pull Requests with Terraform Changes