Skip to content

fix(database): share pool with partial-index conformance worker - #183695

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-pg-partial-index-pool-root-20261025
Oct 25, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-pg-partial-index-pool-root-20261025

Conversation

@steipete

@steipete steipete commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes PostgreSQL conformance failing after all assertions pass because the partial-index fixture starts an undeclared PostgreSQL pool in its inline worker.

Related: #183443. Scheduled main run 40207264272, shard 2 passed all 43 infra files / 252 tests, then failed on Undeclared PostgreSQL pool self-root: other thread 11.

User Impact

No production behavior change. The non-null partial-index ordering fix, query-plan assertions, cleanup, and strict root detector remain unchanged. Production LOC delta: 0; test-only change: +5/-1.

Why This Change Was Made

The inline journal worker bypassed the usual conformance worker constructor and omitted the parent's pool endpoints. Opening its database therefore started four separate I/O services and published the undeclared-root event immediately; extra teardown cannot undo that event. Pass the existing pool endpoints and their transfer list at worker construction so the parent remains the sole pool owner.

Evidence

Linux reproduction uses Node 26.12.1 and CI's exact digest-pinned pgvector PostgreSQL 17 image, with the same extensions and max_locks_per_transaction=512, on an isolated loopback port. The installed container engine is Podman. No production state is used.

Revision / proof Assertions Unhandled root errors Result
38753ff3, introduced fixture 10/10 passed 1 exit 1; 60.22s Vitest / 65.72s wrapper
38753ff3 + this patch 10/10 passed 0 exit 0; 52.51s Vitest / 55.09s wrapper
38753ff3^ (4bbb8154), existing shard 2 278 passed, 1 skipped; 46 files 0 exit 0; 1184.80s wrapper
Main baseline b6876e8e, focused file 10/10 passed 1 exit 1; 53.12s Vitest / 55.68s wrapper
PR head f67d68c3, focused file 10/10 passed 0 exit 0; 52.18s Vitest / 54.68s wrapper
PR head f67d68c3, full shard 2 400/400 passed; 63 files 0 exit 0; 1220.33s wrapper
macOS focused SQLite run 5 passed, 5 PostgreSQL skipped 0 exit 0; 31.32s Vitest / 33.66s wrapper

These are correctness runs, not performance measurements. The fixture does not exist at 38753ff3^ (4bbb8154), so an exact single-file parent comparison is unavailable. Its existing PostgreSQL shard-2 control passed as shown above. The fixed full shard-2 replay also passed on the Linux rig, including its 48-file / 270-test infra group with no unhandled errors. Shard membership changes between revisions because the existing planner assigns by committed weights and file-size estimates; these whole-shard counts are correctness controls, not paired performance samples. CI run 40209943617 completed successfully on exact head f67d68c37bceb75a0e3d49c24efed4cdc1169eca, including PostgreSQL conformance 1/3, 2/3, and 3/3. Shard 2 took 21m04s including setup.

Whole-shard command: node scripts/test-database-conformance.mjs --engine postgres --connection <isolated-dsn> --shard 2/3 -- --maxWorkers=1. No Testbox/Crabbox lease was used.

Focused command: node scripts/test-database-conformance.mjs --engine postgres --connection <isolated-dsn> -- src/infra/database-engine/partial-index-ordering.conformance.test.ts --maxWorkers=1.

Formatting, changed-file lint, and git diff --check passed. Simplification pass retained only the existing endpoint API wiring. Independent subagent review (autoreview route unavailable) is clean at P0–P2; the configured review helper refused the requested provider route, and no configuration was changed.

Expected post-deploy signal: no runtime metric change from this test-only fix; scheduled PostgreSQL conformance shard 2 should finish with zero undeclared-root errors while retaining its ordering checks. No schema changes, allowlist entries, or detector weakening.

Follow-up correction

The merge overlapped with #183675, which had independently landed the same pool inheritance plus construction-failure cleanup. The combined main tree contained a second pool allocation and a duplicate worker-data key. e843be89e6d removes those three duplicate lines while preserving the outer pool and its cleanup.

The corrected owner passes the TypeScript check (the combined tree failed with TS1117), all ten SQLite/PostgreSQL conformance tests without unhandled errors, scoped lint/format, and fresh isolated review. The repaired file was verified at the remote main tip.

Pass the parent PostgreSQL pool endpoints to the inline journal worker so the existing strict root guard does not fail after otherwise successful conformance tests. Keep all ordering assertions and production behavior unchanged.
@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T16:08:27.322548Z f67d68c 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR passes the parent PostgreSQL pool endpoints into the partial-index conformance worker.

Example: Run the partial-index ordering conformance file against PostgreSQL 17.

  • Before: The reported run passes all 10 tests but exits 1 with an undeclared PostgreSQL pool-root error.
  • After: The reported patched run passes all 10 tests, records no root errors, and exits 0.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-supported fixture repair with recorded before/after conformance validation and no actionable defect identified.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, test-only repair is outside the ordinary shipped-entry-point proof gate; its full body records the conformance command failing before and passing after the patch against isolated PostgreSQL 17, plus a passing SQLite run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: PostgreSQL conformance can report passing assertions yet fail the overall process because its fixture starts an undeclared pool.
Reason: The maintainer-authored repair restores meaningful conformance validation through an established ownership contract without changing runtime behavior.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR repairs a source-confirmed PostgreSQL conformance failure with a minimal change and no actionable findings; required PostgreSQL checks remain pending.

Priority: P2
Reviewed head: f67d68c37bceb75a0e3d49c24efed4cdc1169eca

Before merge

None.

Findings

None.

Agent review details

How this fits together

The conformance fixture invokes production database query owners in a worker; inherited endpoints connect that worker to the parent's PostgreSQL I/O services.

flowchart TD
  A[Conformance fixture] --> B[Parent pool owner]
  B --> C[Transferred pool endpoints]
  C --> D[Journal fixture worker]
  D --> E[Production query owners]
  E --> F[Shared PostgreSQL services]
  F --> G[PostgreSQL database]
Loading

Technical review

Best possible solution:

Use the existing endpoint-transfer contract so the fixture shares its parent's pool while retaining strict root detection and all ordering assertions.

Do we have a high-confidence way to reproduce the issue?

The missing endpoints and resulting worker self-root path are visible in current main and match the reported failure; no target code was executed during this read-only review.

Is this the best way to solve the issue?

This is a small root-cause repair using the same pool owner and endpoint-transfer API as existing conformance workers, without weakening the detector or adding test scaffolding.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against fd0106458369.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit b378654 adds src/infra/database-engine/conformance.test-support.ts:26 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b378654d5e8d; files: src/infra/database-engine/conformance.test-support.ts)

PR surface

Tests +4. Total +4 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 5 1 +4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 5 1 +4

Labels

Label changes:

  • add P2: Repairs a concrete conformance infrastructure failure without changing production behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Repairs a concrete conformance infrastructure failure without changing production behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 25, 2026, 12:18 PM ET / 16:18 UTC.

@steipete
steipete merged commit c31e465 into main Oct 25, 2026
131 checks passed
@steipete
steipete deleted the steipete/fix-pg-partial-index-pool-root-20261025 branch October 25, 2026 16:40
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 25, 2026
The independent pool-inheritance repairs in #183675 and #183695 combined into
a second allocation and a duplicate workerData property on main. Keep the
outer pool so construction-failure cleanup owns the same endpoints that are
transferred to the journal worker.

Validation: targeted TypeScript owner check reproduces TS1117 before this
repair and passes afterward; all ten SQLite/PostgreSQL partial-index tests
pass without unhandled errors; scoped lint, formatting, and fresh review pass.
jalehman added a commit that referenced this pull request Oct 25, 2026
#183675 and #183695 both added an inherited Postgres pool to the
partial-index conformance worker. The merged file declared the pool twice
(the inner one shadowing the outer that the catch path closes) and passed
it twice in workerData, failing tsgo (TS1117) and oxlint (no-shadow,
duplicate key) on main.
@steipete

steipete commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

@jalehman, coordinating the overlapping repairs here: e843be89e6d had already removed the inner pool allocation and duplicate key while preserving the outer pool and construction-failure cleanup. 502bf359417 then removed the remaining workerData.postgresPool field.

The child still needs that field alongside the transferred endpoints. I’m restoring exactly one field and retaining the outer pool and cleanup; the resulting file is byte-identical to the version that passed the TypeScript owner check and all ten SQLite/PostgreSQL conformance tests. I’ll recheck current main before the push to avoid another overlap.

Update: 54c0e4dfa92 has restored the field. The remote main file is again byte-identical to the tested repair, so no additional correction was pushed. Thanks for catching and reverting the overlap.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
…claw#183695)

Pass the parent PostgreSQL pool endpoints to the inline journal worker so the existing strict root guard does not fail after otherwise successful conformance tests. Keep all ordering assertions and production behavior unchanged.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
The independent pool-inheritance repairs in openclaw#183675 and openclaw#183695 combined into
a second allocation and a duplicate workerData property on main. Keep the
outer pool so construction-failure cleanup owns the same endpoints that are
transferred to the journal worker.

Validation: targeted TypeScript owner check reproduces TS1117 before this
repair and passes afterward; all ten SQLite/PostgreSQL partial-index tests
pass without unhandled errors; scoped lint, formatting, and fresh review pass.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
openclaw#183675 and openclaw#183695 both added an inherited Postgres pool to the
partial-index conformance worker. The merged file declared the pool twice
(the inner one shadowing the outer that the catch path closes) and passed
it twice in workerData, failing tsgo (TS1117) and oxlint (no-shadow,
duplicate key) on main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant