Repository navigation
Description
Is there an existing issue already for this feature request/idea?
- I have searched for an existing issue, and could not find anything. I believe this is a new feature request to be evaluated.
What problem is this feature going to solve? Why should it be added?
I have had to repeatedly take recovery actions on several of my Clusters, and in some cases restore from backup, due to running out of WAL space on disk. It got to the point I was seeing all clusters eventually fall apart after only a couple days with very light usage. Very similar symptoms to the ones I see described in #8791.
Eventually I stumbled upon this subsection (added originally here). While it's great this is documented and I eventually found it, I feel like this was kinda buried near the bottom of the page.
I am surprised to find this option is not set to something less hazardous by default. It would seem the Postgres docs and wider community agree it should not be set to the default (-1). Of course, there's probably tradeoffs I do not fully understand yet.
Related: #2671
Describe the solution you'd like
I would love to see an improved default setting for max_slot_wal_keep_size to prevent runaway WAL volume disk consumption. I use almost entirely default settings, and found it surprising my cluster could degrade so rapidly with default replication settings.
Doc improvements would also be welcome, but should already be covered by #8791.
Describe alternatives you've considered
One alternative might be to better surface this parameter as a likely solution for replicated clusters in the Cluster's status message. Or perhaps a warning emitted as an Event.
Additional context
For context, I previously used this for all of my cluster configurations (only major version and volume size varies per app):
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: foo
namespace: bar
spec:
imageCatalogRef:
apiGroup: postgresql.cnpg.io
kind: ClusterImageCatalog
name: postgresql
major: 18
instances: 3
bootstrap:
initdb:
storage:
storageClass: baz
size: 20Gi
affinity:
podAntiAffinityType: required
backup:
volumeSnapshot:
className: biff
postgresql:
## Inserting this resolved my runaway disk consumption:
#parameters:
# max_slot_wal_keep_size: 10GB
synchronous:
method: any
number: 1
failoverQuorum: trueand inserted the commented parameter to resolve it.
And of course an obligatory thank you for improving and maintaining this excellent operator. I've been so incredibly pleased with the user experience you've all created here.
Please let me know how I can help.
Backport?
No
Are you willing to actively contribute to this feature?
Yes
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
JohnStarich commentedon Jun 5, 2026
Copying a little bit from here:
Do you think this might still be feasible?
JohnStarich commentedon Jun 9, 2026
Ah, apparently this doesn't completely resolve my issue. Dang.It does seem to help prevent more degradation when 1 of 3 replicas becomes stuck on a forked timeline and can't resolve for extended periods of time though. This means I can at least recover more easily!github-actions commentedon Aug 9, 2026
This issue is stale because it has been open for 60 days with no activity.
github-actions commentedon Aug 24, 2026
This issue was closed because it has been inactive for 14 days since being marked as stale.
JohnStarich commentedon Aug 24, 2026
Could we please reopen this one? It would still be a very helpful improvement to default convention over configuration.
I’ve since verified this did completely resolve my volume consumption issues.