ci: turn off durability on the disposable test PostgreSQL - #812
Merged
Conversation
jason931225
enabled auto-merge
August 19, 2026 01:25
Both CI harnesses boot PostgreSQL with `docker run --rm` and destroy it minutes later, then pay full durability the whole time: fsync, synchronous commit and full-page writes were all at stock defaults. There is nothing to survive a crash here -- if the container dies the run fails loudly and is retried. Measured locally (macOS Docker Desktop, pinned postgres:18.4), applying all 222 migrations over one connection and cloning template databases: stock seed 0.85s clone 0.114s durability off seed 0.62s clone 0.097s (-26% / -16%) CAVEAT: that measurement is NOT representative of the CI runner. Docker Desktop on macOS already buffers through a VM filesystem, so real fsync barely participates. On a Linux runner with a real disk the gap is normally wider, not narrower -- but this change is committed on the standard-practice argument plus a directional local measurement, not on a CI-representative number. Scope is the two disposable CI harnesses only: tools/ci/cargo_needs_postgres.sh (the five PostgreSQL shards) tools/buck/test_needs_postgres.sh (backend + company-conformance) ops/compose.yml is deliberately untouched: that is the developer and deployment topology, where durability is the point. Deliberately NOT included: PGDATA on tmpfs, which is the stronger form of the same idea and standard for disposable CI databases. The container would not start under `--tmpfs /var/lib/postgresql/data` locally even with uid/gid 999, and an unvalidated guess in the same commit would make the measured part unreviewable. It belongs in its own change, measured on Linux. Verified: bash -n on both scripts; bash tools/buck/test_needs_postgres.test.sh -> "test_needs_postgres: PASS" (its 36 grep-noise lines are pre-existing on main, confirmed by running the suite with these edits stashed). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jason931225
force-pushed
the
ci/postgres-durability-off
branch
from
August 19, 2026 01:28
7556f26 to
7d3b1ec
Compare
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.
Independent of #810 and #811 — touches only the two harness scripts, so it can queue in parallel.
Why
Both CI harnesses boot PostgreSQL with
docker run --rmand destroy it minutes later, while paying full durability the whole time:fsync,synchronous_commitandfull_page_writesall at stock defaults. There is nothing to survive a crash — if the container dies the run fails loudly and is retried.This is standard CI-postgres hygiene and it was simply absent.
Measured
Locally (macOS Docker Desktop, pinned
postgres:18.4), applying all 222 migrations over one connection and cloning template databases:Caveat, stated plainly: that measurement is not representative of the CI runner. Docker Desktop on macOS buffers through a VM filesystem, so real
fsyncbarely participates. On a Linux runner with a real disk the gap is normally wider — but this lands on the standard-practice argument plus a directional local number, not on a CI-representative one.Scope
tools/ci/cargo_needs_postgres.shtools/buck/test_needs_postgres.shops/compose.ymlis deliberately untouched — that's the developer and deployment topology, where durability is the point.Deliberately not included
PGDATAon tmpfs — the stronger form of the same idea, and standard for disposable CI databases. The container wouldn't start under--tmpfs /var/lib/postgresql/datalocally even with uid/gid 999. Shipping an unvalidated guess alongside the measured part would make the measured part unreviewable. It gets its own change, measured on Linux.Verification
bash -non both scripts ·bash tools/buck/test_needs_postgres.test.sh→test_needs_postgres: PASSIts 36 grep-noise lines are pre-existing on main — confirmed by re-running the suite with these edits stashed.
🤖 Generated with Claude Code