You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Docs]: WAL disk running out and dealing with it #8791
Is there an existing issue already for your request/idea?
I have searched for an existing issue, and could not find anything. I believe this is a new documentation enhancement to be evaluated.
What problem in the existing documentation this issue aims to solve?
This is the second time a CNPG cluster I have ran, ran out of WAL disk space. First cluster is running on private metal with limited disk, so I had to be stingy on disk. Second time was just not expecting the WAL to grow that big.
If expanding the disk did not fix it then the DBs were already too far out of sync from the remaining WAL files.
What i would do is delete the replica PVCs and pod associated one at a time.
That will force the replica pod to copy the full DB on creation.
If expanding the disk did not fix it then the DBs were already too far out of sync from the remaining WAL files. What i would do is delete the replica PVCs and pod associated one at a time. That will force the replica pod to copy the full DB on creation.
That is what I ended up doing in the most recent case, but it would be nice if the docs recommended this if it is the best approach. Or warned about it and recommended a better way, if it was dangerous.
I am wanting to add that process to the docs, need to ask where it should go, i was thinking at the bottom of the storage page and a link it different sections as it is the same process for changing the storage type. @petterroea i was told that they didn't want to recommend that process but that it is a way to recover without having to restore from a backup and they do have a section for Re-creating Storage
It can be scary and that's why having backups is important. I have done this process over 50 times where i work, 1 mass cluster migration of 30 after creating a database storage type and random ones for clusters that their 2nd and 3rd pods fail after either network or other issues and I haven't lost any data yet.
Hi @petterroea We faced a similar issue.
Our environment runs CloudNativePG on RKE2 (bare-metal) using Longhorn as the default storage class.
During periods of high transaction activity, the WAL volume filled up quickly and Longhorn did not release the used space properly because of its copy-on-write design and internal snapshot behavior.
This caused WAL usage to keep growing until we hit a full-disk outage.
We resolved the issue by using a local-path storage class specifically for WAL (while keeping Longhorn for main data).
We also applied node affinity to ensure the WAL pod is rescheduled to the same node, maintaining data locality.
Since then, WAL growth has been stable and the issue is fully resolved.
example
walStorage:
resizeInUseVolumes: true
size: 10Gi
storageClass: local-path
Potentially another case of Longhorn causing WAL space exhaustion here; in my case I'm on Talos and after faffing around trying to make local-path-provisioner work for a length of time measured in days, I gave up because I was just tired of it.
I'll try and fix it, I'd love to have clusters in-cluster but in the short term I just need it to work so back to a Postgres VM it is 🤷
Interesting. I'm not having any such issues, but I use EBS at work and rook at home. LocalStorage is an interesting solution, but I would then be afraid of accidentally filling the entire disk, which could cause other issues such as logs not being written. This could make debugging an outage worse or even act as a red herring, so this worries me.
Actually, I have seen something similar before, since I made this issue:
This screenshot shows the available disk space on PVCs in a Namespace with CNPG. The line pointed to by an arrow is multiple WALs that suddenly started filling up with no obvious explanation, until they died.
There was no increased traffic or anything that could have explained this behavior, and as you can see, no other node started behaving like that when the failover happened, so it seems like an isolated issue?
Here is a close-up:
Note that multiple WALs decreased at the same rate. The constant 10GiB volumes are the actual non-WAL storage. The dots is from one of the WALs that were only registered intermittently. Something was up. I believe restarting the pods fixed it?
This is on EKS. Not sure if this is relevant to the issue, but this is how WAL exhaustion can look like
I have the same issue, sometime I will see a prometheus alert for a pvc growing on the cnpg cluster, it is always the replicas, and what I do is cnpg destroy cluster_name pod_number. Then it recreates a brand new replica and do a fresh sync. But if there is a better way... because a cluster starting like this :
database-1
database-2
database-3
Is becomming
database-7
database-8
database-9
with time ^^
EDIT : of course I check that I am not running destroy command on the current primary... You have to check with cnpg status before !
Adding a data point from a production incident on CNPG v1.30.0 (OLM install on OpenShift 4.x, CSI RBD storage with allowVolumeExpansion: true / resizeInUseVolumes: true) that might be useful for whatever recovery guidance ends up in the docs here, since it narrows down what actually needs manual intervention.
Our primary's WAL volume filled (WAL archiving had been failing for an unrelated environment reason, so WAL accumulated until the volume filled) and its instance-manager became unreachable. Patching .spec.walStorage.size on the Cluster resource did not propagate to any PVC in the group — including the two healthy replicas' WAL PVCs, which were not disk-constrained and whose instance-managers stayed reachable throughout. That suggests the reconciler's PVC-sizing path is gated on the one unreachable instance rather than scoped per-instance.
Recovery only required patching the failing instance's PVC directly:
to let the CSI resizer act independently of the operator. Once that instance came back to Ready, the operator resumed normal reconciliation on its own and expanded the other two replicas' PVCs with no further manual patching needed.
Might be worth a line in whatever recovery doc comes out of this: an administrator only needs to hand-patch the PVC belonging to the stuck instance — the rest of the group self-heals once the operator is unblocked, no need to patch every PVC in the cluster by hand.
Activity
zoe-tek commentedon Oct 8, 2025
If expanding the disk did not fix it then the DBs were already too far out of sync from the remaining WAL files.
What i would do is delete the replica PVCs and pod associated one at a time.
That will force the replica pod to copy the full DB on creation.
petterroea commentedon Oct 9, 2025
That is what I ended up doing in the most recent case, but it would be nice if the docs recommended this if it is the best approach. Or warned about it and recommended a better way, if it was dangerous.
petterroea commentedon Oct 9, 2025
Deleting PV's with prod data is.... scary 😅
zoe-tek commentedon Oct 9, 2025
I am wanting to add that process to the docs, need to ask where it should go, i was thinking at the bottom of the storage page and a link it different sections as it is the same process for changing the storage type. @petterroea i was told that they didn't want to recommend that process but that it is a way to recover without having to restore from a backup and they do have a section for Re-creating Storage
It can be scary and that's why having backups is important. I have done this process over 50 times where i work, 1 mass cluster migration of 30 after creating a database storage type and random ones for clusters that their 2nd and 3rd pods fail after either network or other issues and I haven't lost any data yet.
petterroea commentedon Oct 9, 2025
That's a relief!
iharw commentedon Oct 31, 2025
Hi @petterroea We faced a similar issue.
Our environment runs CloudNativePG on RKE2 (bare-metal) using Longhorn as the default storage class.
During periods of high transaction activity, the WAL volume filled up quickly and Longhorn did not release the used space properly because of its copy-on-write design and internal snapshot behavior.
This caused WAL usage to keep growing until we hit a full-disk outage.
We resolved the issue by using a local-path storage class specifically for WAL (while keeping Longhorn for main data).
We also applied node affinity to ensure the WAL pod is rescheduled to the same node, maintaining data locality.
Since then, WAL growth has been stable and the issue is fully resolved.
example
walStorage:
resizeInUseVolumes: true
size: 10Gi
storageClass: local-path
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: cnpg-instance
operator: In
values:
- '1'
- '2'
- '3'
weight: 100
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/worker
operator: Exists
podAntiAffinityType: preferred
Sierra1011 commentedon Dec 13, 2025
Potentially another case of Longhorn causing WAL space exhaustion here; in my case I'm on Talos and after faffing around trying to make local-path-provisioner work for a length of time measured in days, I gave up because I was just tired of it.
I'll try and fix it, I'd love to have clusters in-cluster but in the short term I just need it to work so back to a Postgres VM it is 🤷
petterroea commentedon Dec 13, 2025
Interesting. I'm not having any such issues, but I use EBS at work and rook at home. LocalStorage is an interesting solution, but I would then be afraid of accidentally filling the entire disk, which could cause other issues such as logs not being written. This could make debugging an outage worse or even act as a red herring, so this worries me.
petterroea commentedon Dec 13, 2025
Actually, I have seen something similar before, since I made this issue:
There was no increased traffic or anything that could have explained this behavior, and as you can see, no other node started behaving like that when the failover happened, so it seems like an isolated issue?
Here is a close-up:
Note that multiple WALs decreased at the same rate. The constant 10GiB volumes are the actual non-WAL storage. The dots is from one of the WALs that were only registered intermittently. Something was up. I believe restarting the pods fixed it?
This is on EKS. Not sure if this is relevant to the issue, but this is how WAL exhaustion can look like
github-actions commentedon Feb 12, 2026
This issue is stale because it has been open for 60 days with no activity.
pravorskyi commentedon Apr 15, 2026
It's not the stale, I'm facing same issue.
Database is 49 megabytes, and WAL become absurdly 29 Gb in one week!
4pack commentedon May 5, 2026
I can also confirm this as an issue. A 600 megabyte database fills a 30 GB PV way too quickly. In my case, it's only a one of the database pods.
I'm using rook-ceph for my storage backend.
These pods are acting normally.
This one is the problem pod.
hugosxm commentedon May 19, 2026
I have the same issue, sometime I will see a prometheus alert for a pvc growing on the cnpg cluster, it is always the replicas, and what I do is
cnpg destroy cluster_name pod_number. Then it recreates a brand new replica and do a fresh sync. But if there is a better way... because a cluster starting like this :Is becomming
with time ^^
EDIT : of course I check that I am not running destroy command on the current primary... You have to check with cnpg status before !
nitekon1 commentedon Aug 11, 2026
Adding a data point from a production incident on CNPG v1.30.0 (OLM install on OpenShift 4.x, CSI RBD storage with
allowVolumeExpansion: true/resizeInUseVolumes: true) that might be useful for whatever recovery guidance ends up in the docs here, since it narrows down what actually needs manual intervention.Our primary's WAL volume filled (WAL archiving had been failing for an unrelated environment reason, so WAL accumulated until the volume filled) and its instance-manager became unreachable. Patching
.spec.walStorage.sizeon the Cluster resource did not propagate to any PVC in the group — including the two healthy replicas' WAL PVCs, which were not disk-constrained and whose instance-managers stayed reachable throughout. That suggests the reconciler's PVC-sizing path is gated on the one unreachable instance rather than scoped per-instance.Recovery only required patching the failing instance's PVC directly:
to let the CSI resizer act independently of the operator. Once that instance came back to Ready, the operator resumed normal reconciliation on its own and expanded the other two replicas' PVCs with no further manual patching needed.
Might be worth a line in whatever recovery doc comes out of this: an administrator only needs to hand-patch the PVC belonging to the stuck instance — the rest of the group self-heals once the operator is unblocked, no need to patch every PVC in the cluster by hand.
github-actions commentedon Oct 20, 2026
This issue is stale because it has been open for 60 days with no activity.
github-actions commentedon Nov 4, 2026
This issue was closed because it has been inactive for 14 days since being marked as stale.