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

fix: add advisory locking to the client create #239

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

geekbrother
Copy link
Contributor

@geekbrother geekbrother commented Oct 6, 2023

Description

After applying #235 the number of duplicate key value violates unique constraint "clients_pkey" errors decreased, but it still happened.
We can use an advisory locking function pg_advisory_xact_lock(id) with the related to the id key.
The lock is automatically released on COMMIT or ROLLBACK.

Resolves #230

How Has This Been Tested?

Passed CI functional unit tests for the client creation.

Due Diligence

  • Breaking change
  • Requires a documentation update
  • Requires a e2e/integration test update

@geekbrother geekbrother self-assigned this Oct 6, 2023
@arein arein added the accepted The issue has been accepted into the project label Oct 6, 2023
@geekbrother geekbrother marked this pull request as ready for review October 6, 2023 12:18
@geekbrother geekbrother requested a review from xav October 6, 2023 12:25
@geekbrother geekbrother merged commit 46d1797 into main Oct 6, 2023
11 checks passed
@chris13524 chris13524 deleted the max/fix/add_advisory_lock branch October 6, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The issue has been accepted into the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: duplicate key errors for the clients.id constraint
3 participants