Skip to content

Turning backups off fills up disk with WAL logs until crash #2531

Closed
@james-callahan

Description

@james-callahan

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:

  1. 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
  1. perform 1GB or so of writes
  2. 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:

outParameters.Mandatory.Add("archive_mode", "on")
outParameters.Mandatory.Add("archive_command", archive)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions