Description
Overview
If I do not specify a backup repo (e.g. because I don't want backups), then the WAL will grow until storage is exhausted.
Eventually the database crashes with "No space left on device" and doesn't restart, logging "FATAL: could not write lock file "postmaster.pid": No space left on device"
Environment
Please provide the following details:
- Platform: EKS
- Platform Version: 5.0.0
- PGO Image Tag: ubi8-5.0.0-0
- Postgres Version 13
- Storage: ??
Steps to Reproduce
REPRO
Provide steps to get to the error condition:
- create cluster:
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
metadata:
name: hippo
spec:
image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres-ha:centos8-13.3-4.7.0
postgresVersion: 13
monitoring:
pgmonitor:
exporter:
image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres-exporter:ubi8-5.0.0-0
instances:
- name: db
replicas: 1
dataVolumeClaimSpec:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 1Gi
backups:
pgbackrest:
image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:centos8-2.33-0
- perform 1GB or so of writes
- observe DB is down due to out-of-space
EXPECTED
WAL would not be retained if there is no backup repo.
ACTUAL
WAL logs fill up disk
Additional Information
I think this could be fixed via by setting archive_command
to /bin/true
when there are no backup repos?
Alternatively, you could just make it possible for me to override archive_mode
or archive_command
myself. Currently they are forced to be on:
postgres-operator/internal/pgbackrest/postgres.go
Lines 39 to 40 in 21905f0