Skip to content

Conversation

dkarter
Copy link
Contributor

@dkarter dkarter commented Sep 12, 2025

Motivation

The default behavior of using locks when checking migration status caused a hard
to debug bug when migration_lock: :pg_advisory_lock was set on the repo config.

The bug was causing multiple slow downs on web requests due to attempts to acquire locks
on the database.

Generally locks should not be necessary for the pending migration check since we
are just reading from the migrations table and not actually running the migrations.

Note

I wasn't sure if we should just deprecate the option altogether. For now that means that users can still enable migration_lock if they find a need for it - I'm not sure if that need really exists. Open to change that.

Changes

Made :migration_lock option on CheckRepoStatus default to true.

@dkarter dkarter marked this pull request as ready for review September 12, 2025 15:44
@josevalim josevalim merged commit 95fde93 into phoenixframework:main Sep 12, 2025
2 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@josevalim
Copy link
Member

Please give it a try for a while in your app and let us know if it all goes well!

@dkarter dkarter deleted the fix/disable_migration_lock_by_default branch September 12, 2025 16:03
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.

2 participants