Share the retry rule and copy budget helpers - #1183
Merged
Merged
Conversation
xata-bot
approved these changes
Sep 10, 2026
xata-bot
left a comment
There was a problem hiding this comment.
✅ Approved by the pgstream review agent.
This is a pure mechanical extraction/export of existing logic (retry classification, copy budget sizing, retry policy accessor) with no behavioral change; tests were updated in lockstep and verify identical outputs.
tier T1-agent · 4 files / 28 substantive lines · risk low. This is an automated review and does not replace human judgement on anything it escalates.
kvch
enabled auto-merge (squash)
September 10, 2026 13:21
CoverageTotal: 62.7% (±0.0% vs Coverage in packages changed by this PR:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Three small extractions so that a second component can reuse the postgres target behaviour the bulk ingest writer already implements: how a failure is classified as retriable, which retry policy applies once the default is resolved, and how large the concurrent COPY budget may be.
Nothing changes about what any of them decide. Each is a move or an extraction, verified by the existing tests.
This is the first of four stacked PRs splitting #1129. On its own it adds no functionality; the consumer arrives in the branch above it.
Related Issue(s)
Type of Change
Changes Made
retrier.IsRetriableErrorCopyBudgetReserveandCopyBudgetSizefrompkg/wal/processor/postgrestointernal/sync, next to the weighted semaphore they sizeConfig.EffectiveRetryPolicy, returning the postgres writer's retry policy once its default has been applied.retryPolicystays unexported and remains the single definition.Testing
Checklist