-
Notifications
You must be signed in to change notification settings - Fork 42
Improve connection retry error mapping #604
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the connection retry logic by making constraint violation and permission denied errors non-retriable. It also refactors the mapError function to MapError to make it publicly accessible for use in the retry logic.
- Adds logic to mark constraint violation and permission denied errors as non-retriable
- Exports the
mapErrorfunction asMapErrorfor use across packages - Adds comprehensive test coverage for the
isRetriableErrorfunction
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/postgres/errors.go | Exports mapError function as MapError |
| internal/postgres/retrier/pg_querier_retrier.go | Implements non-retriable error checks for permission denied and constraint violation errors |
| internal/postgres/retrier/pg_querier_retrier_test.go | Adds test cases for isRetriableError function covering various error types |
| internal/postgres/pg_utils.go | Updates function call from mapError to MapError |
| internal/postgres/pg_tx.go | Updates function calls from mapError to MapError |
| internal/postgres/pg_replication_conn.go | Updates function calls from mapError to MapError |
| internal/postgres/pg_conn_pool.go | Updates function calls from mapError to MapError |
| internal/postgres/pg_conn.go | Updates function calls from mapError to MapError |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
Description
This PR updates the logic that determines if a connection error is retriable to not retry in the following cases:
Related Issue(s)
Type of Change
Testing