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

Switch postgres to use a set and return an error if a duplicate caveat name is given #2199

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

josephschorr
Copy link
Member

This condition should never happen in real code, but the constraint failure error was causing the PG driver to retry over and over, making the test incredibly slow. Instead, we now check on the client side and return a non-retryable error.

…t name is given

This condition should never happen in real code, but the constraint failure error was causing the PG driver to retry over and over, making the test incredibly slow. Instead, we now check on the client side and return a non-retryable error.
@josephschorr josephschorr requested a review from a team as a code owner January 9, 2025 22:45
@github-actions github-actions bot added the area/datastore Affects the storage system label Jan 9, 2025
Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Only question is whether this would be a hot path, and if the use of a set instead of a slice is a concern. If not, :shipit:

@josephschorr josephschorr added this pull request to the merge queue Jan 10, 2025
@josephschorr
Copy link
Member Author

@tstirrat15 we need to collect the names anyway, so converting from a set -> slice should be fairly low impact

Merged via the queue into authzed:main with commit 3379931 Jan 10, 2025
23 checks passed
@josephschorr josephschorr deleted the pg-caveat-dupe branch January 10, 2025 00:33
@github-actions github-actions bot locked and limited conversation to collaborators Jan 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/datastore Affects the storage system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants