Skip to content

ci: turn off durability on the disposable test PostgreSQL - #812

Merged
jason931225 merged 1 commit into
mainfrom
ci/postgres-durability-off
Aug 19, 2026
Merged

ci: turn off durability on the disposable test PostgreSQL#812
jason931225 merged 1 commit into
mainfrom
ci/postgres-durability-off

Conversation

@jason931225

Copy link
Copy Markdown
Collaborator

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 --rm and destroy it minutes later, while paying full durability the whole time: fsync, synchronous_commit and full_page_writes all 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:

seed clone
stock 0.85s 0.114s
durability off 0.62s 0.097s
−26% −16%

Caveat, stated plainly: that measurement is not representative of the CI runner. Docker Desktop on macOS buffers through a VM filesystem, so real fsync barely 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

file why
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's the developer and deployment topology, where durability is the point.

Deliberately not included

PGDATA on tmpfs — the stronger form of the same idea, and standard for disposable CI databases. The container wouldn't start under --tmpfs /var/lib/postgresql/data locally 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 -n on both scripts · bash tools/buck/test_needs_postgres.test.shtest_needs_postgres: PASS

Its 36 grep-noise lines are pre-existing on main — confirmed by re-running the suite with these edits stashed.

🤖 Generated with Claude Code

@jason931225
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
jason931225 force-pushed the ci/postgres-durability-off branch from 7556f26 to 7d3b1ec Compare August 19, 2026 01:28
@jason931225
jason931225 added this pull request to the merge queue Aug 19, 2026
Merged via the queue into main with commit a3686c7 Aug 19, 2026
27 checks passed
@jason931225
jason931225 deleted the ci/postgres-durability-off branch August 19, 2026 02:13
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