Skip to content

feat(pgpm): add pgpm tune command for throwaway environments#1336

Merged
pyramation merged 1 commit into
mainfrom
feat/pgpm-tune
Jul 7, 2026
Merged

feat(pgpm): add pgpm tune command for throwaway environments#1336
pyramation merged 1 commit into
mainfrom
feat/pgpm-tune

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Adds pgpm tune — a CLI command that disables PostgreSQL durability for throwaway databases (CI service containers, local dev, test containers). Motivated by CI flakiness in constructive-db (constructive-io/constructive-db#1925): WAL checkpoints stalling on runner disk I/O were pushing DDL-heavy provisioning tests past their jest timeouts. With this command, that repo's workflow psql one-liner can become pgpm tune --yes.

Applies via ALTER SYSTEM + pg_reload_conf() (all SIGHUP-reloadable — no restart):

fsync = off
synchronous_commit = off
full_page_writes = off
checkpoint_timeout = 30min
max_wal_size = 8GB

Usage:

pgpm tune --yes          # non-interactive (CI)
pgpm tune --reset --yes  # ALTER SYSTEM RESET back to server defaults

Follows the admin-users bootstrap pattern (prompter confirm gated by --yes, getPgPool from pg-cache, Logger); registered in createPgpmCommandMap with the pg-teardown wrapper. Verified against a live postgres-plus:18 container: settings apply and reset correctly.

Note: pnpm lint currently fails repo-wide (ESLint 9 installed but config is .eslintrc.json) — pre-existing, unrelated to this change.

Link to Devin session: https://app.devin.ai/sessions/7943c7526d254aa4828be110fbb3f272
Requested by: @pyramation

@pyramation pyramation self-assigned this Jul 7, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@pyramation pyramation merged commit 7595b4e into main Jul 7, 2026
36 checks passed
@pyramation pyramation deleted the feat/pgpm-tune branch July 7, 2026 01:14
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