WAL arhives uploaded always, ignoring isWALArchiver setting
If user will omit or configure isWALArchiver=false inside cluster CR - barman-cloud plugin will still upload WAL to S3.
Steps done:
Tried omitting isWALArchiver:
plugins:
- name: barman-cloud.cloudnative-pg.io
enabled: true
parameters:
barmanObjectName: cnpg-cluster-01-backup
and setting it to false:
plugins:
- name: barman-cloud.cloudnative-pg.io
enabled: true
isWALArchiver: false
parameters:
barmanObjectName: cnpg-cluster-01-backup
Expected result: no wal folder would be created
Actual result: cnpg-cluster-01-backup S3 object get wal folder and files inside after cluster creation
The barman-cloud plugin currently ignores the isWALArchiver setting—WAL files are always uploaded to S3, even if you set isWALArchiver: false or omit it. This matches both the code and documentation, which do not implement logic to disable WAL archiving based on this setting. The documentation only describes enabling WAL archiving by setting isWALArchiver: true, but does not mention disabling it by setting it to false or omitting it. So, the behavior you’re seeing is expected with the current implementation. Reference
To reply, just mention @dosu.
Docs are dead. Just use Dosu.
This breaks restoring a cluster from an S3 bucket as described in https://cloudnative-pg.io/plugin-barman-cloud/docs/usage/#restoring-a-cluster. When both the plugins & externalClusters are configured with bootstrap: recovery in the Cluster resource, the plugin assumes it also has to backup to the bucket and fails with the Expected empty archive error before the restore is started.
When restoring a cluster, the plugin should only consider read-only connections (as per documentation) and skip the read-write configurations (if read-only configurations are set).
Hi @sjadema can you please clarify what exactly is breaking restore behind "this"?
Hi @dragoangel, sorry for being a bit vague. In the documentation, an example is shown which has both the externalClusters and the plugins sections:
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: cluster-restore
spec:
instances: 3
imagePullPolicy: IfNotPresent
bootstrap:
recovery:
source: source
plugins:
- name: barman-cloud.cloudnative-pg.io
isWALArchiver: true
parameters:
# Backup Object Store (push, read-write)
barmanObjectName: minio-store-bis
externalClusters:
- name: source
plugin:
name: barman-cloud.cloudnative-pg.io
parameters:
# Recovery Object Store (pull, read-only)
barmanObjectName: minio-store
serverName: cluster-example
storage:
size: 1Gi
This configuration doesn't work and I think that is because the isWALArchiver property isn't being honored. So by 'this', I ment the fact the isWALArchiver setting is ignored. In the example, it clearly shows a difference between the plugins & externalClusters, but that configuration difference doesn't seem to trigger a runtime difference. Furthermore, it seems like the plugin is validating both connections, starting with the plugins and then determines the bucket is invalid, because it has content in it, and exiting with an error before the recovery procedure can start. The recovery actually requires that there is content in the bucket.
In our case we're using the same bucket in both the externalClusters & plugins section because we want to restore a cluster from a backup for disaster recovery and use that same bucket to keep on creating backups.
I ran into the exact same issue as @sjadema and would also be interested in a solution. (I didn't even attempt to turn off the isWALArchiver setting, though, as I expected to be able to just restore from my backup)
I wanted to use the same bucket for both backup and restore in order to restore from my backup and then keep creating backups afterwards.
Having had a look at this again, I see now that I did not fully understand how backups are intended to be done with the barman cloud plugin and that my problem was not the same as in this issue.
I understand now that writing into an existing backup from a new cluster can be problematic and that the plugin rightfully checks and fails if there is already data in the backup destination. I adjusted my setup to start a new line of backups after a restore by changing the name of the postgresdb cluster and now it works fine.