Postgres High Walusage

PostgresHighWALUsage #

Meaning #

The Write Ahead Log (WAL) is consuming more than 1Gi of storage on at least one cluster member. This usually indicates that a remote target is unreachable, such as the S3 backup storage or a cluster replica.

Impact #

When the WAL reaches a certain size it will fill up the disk or exceed its maximum size and block the database cluster from functioning.

Further the backup of the cluster is blocked and will be incomplete starting from the point in time the issue started to appear.

Diagnosis #

Find current master pod:

kubectl get pods --selector spilo-role=master

Check member list (replace ${master_pod?} with the Pod from above):

kubectl exec -it ${master_pod?} -- patronictl list

Check WAL target configuration (replace ${master_pod?} with the Pod from above):

kubectl exec -it ${master_pod?} -- env | sort

Mitigation #

Restoring connectivity to the WAL archive target, should resolve the alert and issue.