Skip to content

fix(infra): pin prod app-pg data volume to 5Gi - #214

Closed
alex-struk wants to merge 1 commit into
developfrom
fix/prod-app-pg-pgdata-5gi
Closed

fix(infra): pin prod app-pg data volume to 5Gi#214
alex-struk wants to merge 1 commit into
developfrom
fix/prod-app-pg-pgdata-5gi

Conversation

@alex-struk

Copy link
Copy Markdown
Collaborator

Context

Prod went down (2026-06-29) when the bcgov-di-app-pg Postgres data volume (1.5Gi) filled to 100% and the database crashed — taking backend-services and temporal-worker down with it (both depend on this DB). The volume was expanded live 1.5Gi → 5Gi to restore service.

Change

Pin app-pg pgdata to 5Gi (prod-only, via the prod-resources component) so the manifest matches the live PVC. Without this, the Crunchy operator would keep trying to reconcile it down to the base 1.5Gi and emit the recurring spec.resources.requests.storage: field can not be less than previous value error (PVCs can't shrink). Same pattern already used for temporal-pg. base/test stay at 1.5Gi.

Validation

oc kustomize of the generated overlay:

  • prod: app-pg 5Gi, temporal-pg 5Gi
  • test: app-pg 1.5Gi, temporal-pg 1.5Gi

⚠️ This is a band-aid, not the root fix

The disk filled because of WAL accumulation, and WAL accumulated because the pgBackRest backup repo (repo1, 10Gi) is 100% fullarchive-push fails with "No space left on device" → Postgres won't recycle un-archived WAL. The repo is full of an old full backup (06-27) plus a long chain of ~260M hourly incrementals that aren't being expired.

WAL archiving is still failing in prod right now, so the 5Gi volume will refill unless the backup repo is addressed:

  • Tighten pgBackRest retention and expire old backups to free repo space, and/or
  • Increase the netapp-file-backup quota (currently maxed at 32Gi: app 10Gi + temporal 22Gi).

This PR only stops the manifest-vs-live drift; the repo/retention fix is tracked separately.

🤖 Generated with Claude Code

The prod app Postgres data volume was expanded in-place from 1.5Gi to 5Gi after
pg_wal accumulation filled the original volume and crashed the database (prod
outage). The base manifest still requests 1.5Gi, so the Crunchy operator would
emit the recurring "field can not be less than previous value" reconcile error.

Pin app-pg pgdata to 5Gi via the prod-resources component (same pattern as
temporal-pg). base stays 1.5Gi for ephemeral/test instances.

Note: this only codifies the storage size. The underlying cause of the WAL
growth is the pgBackRest backup repo (repo1) being full, which blocks WAL
archiving — that must be addressed separately or the volume will refill.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alex-struk

Copy link
Copy Markdown
Collaborator Author

Folded into #215 so all the outage-related infra fixes (block incremental + app-pg 5Gi pin) are in a single PR.

@alex-struk alex-struk closed this Jun 29, 2026
@alex-struk
alex-struk deleted the fix/prod-app-pg-pgdata-5gi branch June 29, 2026 16:29
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