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

chore: remove pg advisory lock #690

Merged
merged 2 commits into from
Jul 16, 2024
Merged

chore: remove pg advisory lock #690

merged 2 commits into from
Jul 16, 2024

Conversation

Horusiath
Copy link
Collaborator

We noticed that occasionally Postgres advisory lock created when creating a new user is grinding the database down them down to halt: since it's an entire table lock rather than row-level lock.

This PR is supposed to help by removing the advisory lock. Additionally concurrent conflicts caused by unlikely situation when two requests will try to create the same user will result in HTTP error response for one of them.

@Horusiath Horusiath requested a review from appflowy July 15, 2024 17:12
@speed2exe speed2exe merged commit a8ed5be into main Jul 16, 2024
8 of 9 checks passed
@speed2exe speed2exe deleted the fix-user-creation-deadlock branch July 16, 2024 02:44
@appflowy
Copy link
Contributor

The Advisory locks can be acquired at session level or at transaction level. it seems like we use it on transaction level. it shouldn't lock entire table.

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.

3 participants