Skip to content

perf(stack): reuse postgres image for storage helper - #6760

Merged
jgoux merged 28 commits into
developfrom
perf/stack-postgres-storage-helper
Sep 24, 2026
Merged

jgoux merged 28 commits into
developfrom
perf/stack-postgres-storage-helper

Conversation

@jgoux

@jgoux jgoux commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Use the pinned Postgres service image for database storage operations. The image includes GNU cp, while BusyBox supplies the remaining filesystem tools. This removes the separate Debian helper pull that could fail under registry rate limits.

Pin the two database versions in the stack catalog to their republished image digests. The storage integration suite exercises snapshot save, restore, retention, metadata preservation, and cleanup against the published image.

The shared volume helper introduced by #6710 keys its container by both mounts and Postgres image, so separate database versions use the correct image.

jgoux and others added 14 commits September 22, 2026 08:37
Compiled CLI builds now enable minification, ESM, and bytecode at depth
2 to reduce startup work. Release, local, and E2E binaries share the
same compilation options, including the local npm release workflow.

Depth 2 limits the binary-size cost compared with compiling all nested
functions ahead of time.

---------

Co-authored-by: Julien Goux <hi@jgoux.dev>
A Postgres data directory is mostly small files, so one clone is cheaper
than a clone per file. Unsupported entries still use the per-file copy.
Linux reflinks when the filesystem can, and Windows uses robocopy.
A failed or interrupted host copy removes the partial tree first.
Shadow destroy issues docker stop and rm in the background. An explicit
stop, including the one before a snapshot, still waits for a checkpoint.
Reuse one helper container per volume, remember the daemon identity,
and turn crash safety off for a shadow that is deleted after the diff.
The phase file was only for benchmarks. A shared helper is removed
only by the process that created it, so another diff cannot delete
the container the first one is using.
docker exec cannot use a container left in created, and adopting it
again left later diffs stuck. The helper handle type stays private.
A cancel during chmod left the failed host copy in place, and the
interrupt test read the last argument, which is /NP on Windows.
Effect lint rejects node:fs and node:path in this package, and those
warnings fail the quality check.
Keep the explicit copy destination from the base and write the partial
fixture through Effect file APIs.
Keep develop's oxfmt stub and root-key default. Keep the host-command
directory copy and the spawner it needs.
Parallel tests reused one stack id, so on Linux they shared a data
directory and the pooler database exited during ready.
@jgoux
jgoux requested a review from a team as a code owner September 23, 2026 16:45
@jgoux jgoux self-assigned this Sep 23, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

All four Claude findings are supported by the code; Codex reported none. PostgreSQL 15 has database integration coverage, but its snapshot helper path is untested. The pinned image contents could not be inspected in this pass, so these findings do not establish that either image currently lacks a required tool.

Findings

Severity Location Category Sources Claim
🟡 MINOR packages/stack/src/storage/DockerDatabaseStorage.ts:831 maintainability claude Snapshot operations depend on specific binaries and applets in the pinned PostgreSQL images, but the artifact catalog does not record or check those requirements.
🟡 MINOR packages/stack/src/storage/DockerDatabaseStorage.integration.test.ts:81 test-coverage claude The changed PostgreSQL 15 digest is not exercised by a snapshot helper test; every Docker storage integration case selects PostgreSQL 17.
🟡 MINOR packages/stack/src/storage/DockerDatabaseStorage.integration.test.ts:151 test-reliability claude The new xattr preservation check fails the entire integration test on a Docker volume filesystem that cannot store user xattrs.
⚪ NIT packages/stack/src/storage/DockerDatabaseStorage.ts:630 consistency claude Helper commands mix bare tools resolved through PATH with absolute BusyBox applet paths, making their command requirements harder to track.

Stats

Claude findings: 4 · Codex findings: 0 · Confirmed: 4 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

@jgoux
jgoux force-pushed the perf/stack-postgres-storage-helper branch from 03e1e69 to 45c6f27 Compare September 23, 2026 17:36
@jgoux
jgoux changed the base branch from develop to perf/stack-shadow-diff September 23, 2026 17:37
Base automatically changed from perf/stack-shadow-diff to develop September 24, 2026 10:21
@jgoux
jgoux added this pull request to the merge queue Sep 24, 2026
Merged via the queue into develop with commit 65237d0 Sep 24, 2026
30 checks passed
@jgoux
jgoux deleted the perf/stack-postgres-storage-helper branch September 24, 2026 11:39
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.

2 participants