Skip to content

Keep busy retained recovery from blocking unrelated batches (0.6) - #666

Merged
hardbyte merged 2 commits into
release/0.6.6from
brian/fix-retained-recovery-contention-0.6
Nov 7, 2026
Merged

hardbyte merged 2 commits into
release/0.6.6from
brian/fix-retained-recovery-contention-0.6

Conversation

@hardbyte

@hardbyte hardbyte commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

A busy claim-head row encountered during retained-body recovery could roll back an entire rescue or worker completion batch, delaying unrelated work.

Rescue now selects and hydrates inside a savepoint. It defers the exact historical attempts whose required claim heads are busy, rolls back their partial transitions, and retries only the original selected population. Receipt cursors retain the deferred open evidence, so the attempt remains eligible. Missing or ambiguous bodies still fail explicitly.

Public completion methods retain their atomic NOWAIT errors. Only the worker batcher handles SQLSTATE 55P03 by retrying each original request individually. Successful requests receive success, a genuinely busy request keeps its database error, and a genuinely stale request receives a stale acknowledgment. Carried runtime jobs and successful duplicate pairs keep their existing behavior. Flush timing includes fallback work.

This backports the contention correction from #664 onto #663/#665. It preserves the 0.6 receipt deadline path and does not include the optional rescue-drain changes in #647, #648 or #650. There are no schema changes or new strong relation locks. Ordinary rescue adds a savepoint and candidate predicates; historical contention can cause bounded retries.

Validation:

  • Root and Python Rust workspaces pass formatting, all-target/all-feature Clippy with warnings denied, and builds.
  • 68 focused storage regressions and two worker response tests pass on PostgreSQL 18.3, with zero ignored cases.
  • New tests cover materialized, receipt and callback rescue, deferred cursor evidence, strict direct-completion errors, and busy/successful/stale/carried worker responses. Corresponding main-branch tests fail against the prior implementation.
  • Both new worker tests also pass with the existing canonical completion test after isolating fixture setup from shared storage routing.
  • Full CI for head 59649b2e passes all 31 jobs, including both database majors and both tested Python versions.
  • The matched release workload pressure comparison remains pending; this PR does not establish the release gate.

The retained-body recovery limitations documented in #663 remain.

@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0a779196-8f51-4f9f-a3c5-c82b01d29646

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T05:54:39.019448Z fce272e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@hardbyte
hardbyte merged commit 09e502b into release/0.6.6 Nov 7, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant