Skip to content

fix: locking the tables for too much time #214

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

Merged
merged 2 commits into from
Jul 15, 2025

Conversation

steve-chavez
Copy link
Member

If the worker process the queue for a long time, it will preventing operations like TRUNCATE or VACUUM FULL from completing.

This is because it acquires an AccessShareLock on the extension tables and only releases it once it goes to sleep.

Now we use ConditionalLockRelationOid and unlock the tables at the end of each transaction, allowing VACUUM FULL or TRUNCATE to finish fast.

If the worker process the queue for a long time, it will
preventing operations like TRUNCATE or VACUUM FULL from completing.

This is because it acquires an AccessShareLock on the extension tables
and only releases it once it goes to sleep.

Now we use `ConditionalLockRelationOid` and unlock the tables
at the end of each transaction, allowing VACUUM FULL or TRUNCATE to
finish fast.
@steve-chavez steve-chavez marked this pull request as ready for review July 15, 2025 19:21
@steve-chavez steve-chavez merged commit bc2421b into supabase:master Jul 15, 2025
11 of 12 checks passed
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