Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Review of PR 827: persist backoff for local handler retries No blocking issues found.
One non-blocking note: a direct-path preparation failure with |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Closing as superseded by #819, which merged after this was reviewed and conflicts with it. #819 already sends local handler failures through one counted statement ( |
A PostgreSQL local handler failure classified
Retrynow gets one policy, whichever path ran the attempt: it counts againstMaxDispatchAttempts, persists exponential backoff (1 s to 5 min) indeliver_at, and dead-letters at the limit. An ordered row parks its key at the limit.What the code did before: the issue says commit-triggered dispatch retried forever. That's not quite right. Local consumption always sets
admission, so commit, recovery and ordered dispatch all went through the countedFailurestatement. Every path had the poison budget, but none of them had backoff, so a failing handler was retried on each recovery or lane pass until it was poisoned. The local transport page promised backoff without a poison budget, which matched neither the code nor the reference pages (postgres-store.md,direct-dispatch.md,postgres-maintenance.mdanddocs/decisions.md), which all describe the budget. I kept the budget, since that's what the decision record and the issue's expected behaviour ask for, and added the backoff.Changes:
PostgreSqlPoisonSql.Failuretakes an optional clock expression. When it's set, a row that stays pending gets the same backoff expression asRetry, which now shares it._failDirect(used only for local handler failures, on the commit and recovery paths) and a new ordered-lane_failLocaluse it. Ordered preparation errors and the public explicit-timeRecordFailureAsyncare unchanged.LocalTransportTests.Retry_failures_back_off_and_dead_letter_at_the_limit_on_every_dispatch_pathcovers the direct, recovery and ordered paths: the first failure gives attempts = 1 withdeliver_atone second after the failure, and the second due attempt dead-letters. Before the fix it failed on all three paths with a nulldeliver_at.transports/postgresql-local.mdcorrected; the three reference pages note the backoff.Builds on: the existing fenced poison transition and the native-retry backoff from #672. No native client feature is involved; this is store SQL. Nothing duplicated.
Per-message cost: none on the success path. A local handler failure runs the same single statement with one extra column assignment, 0 B.
Validation (net10.0 and net11.0):
LocalTransportTests,PoisonTests,DispatchBackoffTests,OrderedDispatchTests,MaintenanceTests,LocalTransportConformanceTests,ChangeCaptureTests,SharedMaintenanceContractTests,TransactionalCompletionTests,SagaTimeoutTestsandSchedulingRequirementTestsall pass.npm run buildinwebsite/passes.Per-consumer schedules stay in #804.
Closes #823