Skip to content

AI-1823 PVC Size Changes & Logging Changes - #236

Open
dbarkowsky wants to merge 7 commits into
developfrom
fix/shrink-pvcs
Open

AI-1823 PVC Size Changes & Logging Changes#236
dbarkowsky wants to merge 7 commits into
developfrom
fix/shrink-pvcs

Conversation

@dbarkowsky

@dbarkowsky dbarkowsky commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

One thing I noticed during this. When the backup PVC is full, the PVC for database data begins to fill with the write-ahead files. As soon as I expanded the backup PVC, Crunchy relieved the data PVC of all those files. As a result, the data PVC probably didn't need to be increased, but at least this gives room for expected growth.

Changes

  • Changed many defaults for PVCs at 10Gi down to 2Gi.
    • But also prod overrides for larger PVCs needed.
  • Also increased the size for the app-pg PVC to permit the DB restore.
  • Lowered restore timeline from 30 to 14 days.
  • Added drop conditions to the promtail configs. The goal is to drop repetitive logging that we're not interested in (Loki-wise). That means stuff like /health or /metrics.
  • Upped db pod replicas to 2. This seems like a reasonable requirement if there's going to be high-traffic use in production.

Testing

Checklist

By submitting this pull request, I acknowledge that I have attempted to meet the following:

  • a self-review of my code
  • commented code particularly in hard-to-understand areas
  • corresponding changes to the documentation where required
  • changes tested to the best of my ability
  • no new errors or non-functional code

@dbarkowsky dbarkowsky changed the title 10Gi to 2Gi loki and prometheus pvcs AI-1823 PVC Size Changes Jul 21, 2026
@dbarkowsky dbarkowsky changed the title AI-1823 PVC Size Changes AI-1823 PVC Size Changes & Logging Changes Jul 21, 2026
alex-struk added a commit that referenced this pull request Jul 24, 2026
…anch

The postgrescluster.yml PVC sizing + retention edits are superseded and
wrong-layer, so they are removed here to leave this PR as the numeric-zero
recovery feature only:

- pgdata 5Gi and retention 14d are already on develop (block-incremental +
  retention reduction) / covered by #236 (AI-1823).
- prod repo1 genuinely needs 22Gi (live: 22Gi PVC, 12G used, spec still 10Gi,
  PersistentVolumeResizing=Invalid), but that belongs as a prod-resources
  overlay patch in #236 — not a base edit that would also force fd34fb-test
  and ephemeral instances up.

File is now identical to develop; this PR no longer touches infra.

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

Copy link
Copy Markdown
Collaborator

While cleaning up an old branch (#169) that also touched temporal/postgrescluster.yml, I dropped its infra hunk in favour of this PR — but one piece isn't covered here yet and I think it belongs in this stack: the temporal-pg repo1 (pgBackRest backup) PVC.

Checked live fd34fb-prod today:

Applied spec Live PVC Used
pgdata 5Gi 5Gi 647M (13%)
repo1 (backups) 10Gi 22Gi 12G (51%)

The repo1 PVC was already expanded in-place to 22Gi (~125d ago), but nothing patches repo1 for prod, so the applied spec is still the base 10Gi. That mismatch is live on the cluster:

$ oc -n fd34fb-prod get postgrescluster bcgov-di-temporal-pg \
    -o jsonpath='{range .status.conditions[*]}{.type}={.status} :: {.reason}{"\n"}{end}'
...
PersistentVolumeResizing=False :: Invalid

Same shrink-conflict signature as the pgdata one this PR already documents — desired(10Gi) < actual(22Gi), operator won't shrink. And it's a real requirement, not just leftover: repo1 is using 12G, above the 10Gi base, even after block-incremental + 14-day retention.

Suggested fix (mirrors the pgdata patch already in prod-resources): add a prod-only repo1 patch so base stays 10Gi for test/ephemeral —

  - target:
      kind: PostgresCluster
      name: temporal-pg
    patch: |
      - op: replace
        path: /spec/backups/pgbackrest/repos/0/volume/volumeClaimSpec/resources/requests/storage
        value: 22Gi

(#169's original approach edited the base to 22Gi, which would also push fd34fb-test + ephemeral instances up — hence flagging it here instead. Not urgent; the volume is healthy at 51%.)

Unrelated note from the same look: the recent temporal-pg-repo1-full job Error entries are pgBackRest lock contention (unable to acquire lock … is another pgBackRest process running?), i.e. a double-scheduled full, not a space problem.

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