Skip to content

[Feature / Bug]: ERROR: WAL archive check failed for server restore: Expected empty archive #350

@smiyc

Description

@smiyc

During restore tests

...
    recovery:
      source: restore
      database: app
      secret:
        name: restore-app       
      # recoveryTarget:
      #   targetTime: "2025-05-16 10:21:25.723492+02"

  externalClusters:
  - name: restore
    plugin:
      name: barman-cloud.cloudnative-pg.io
      parameters:
        barmanObjectName: restore-c800
        serverName: restore
...

I disabled the plugin by setting enabled and isWALArchiver to false

...
  plugins:
  - name: barman-cloud.cloudnative-pg.io
    enabled: false    
    isWALArchiver: false
    parameters:
      barmanObjectName: restore-c800        
...
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
  name: restore-c800
spec:
  retentionPolicy: "7d"
  configuration:
    destinationPath: "s3://xxx"     
    endpointURL: "https://sxxx"
    endpointCA:
       name: xxx-ca
       key: tls.crt     
    s3Credentials:
      accessKeyId:
        name: xxx-creds
        key: ACCESS_KEY_ID
      secretAccessKey:
        name: xxx-creds
        key: ACCESS_SECRET_KEY
    wal:
      compression: gzip # bzip2;gzip;snappy
      maxParallel: 2
    data:
      compression: gzip # bzip2;gzip;snappy
      immediateCheckpoint: true  
      jobs: 2         

but the plugin still complains about

ERROR: WAL archive check failed for server restore: Expected empty archive

As a workaround, I commented out the plugin

...
  # plugins:
  # - name: barman-cloud.cloudnative-pg.io
  #   enabled: false    
  #   isWALArchiver: false
  #   parameters:
  #     barmanObjectName: restore-c800      
...

After that, the restore is working.

Then comment it in (not enabled)

  plugins:
  - name: barman-cloud.cloudnative-pg.io
    enabled: false
    isWALArchiver: false
    parameters:
      barmanObjectName: restore-c800

no error

enabling it

  plugins:
  - name: barman-cloud.cloudnative-pg.io
    enabled: true    
    isWALArchiver: true
    parameters:
      barmanObjectName: restore-c800

no error

select pg_switch_wal();

no error, the not empty archive is being used.

IMO if the plugin is disabled and not used as WALArchiver, it should not check for an empty archive but during enabling it should.
But I the plugin would behave like this, what should be the consequence during enabling on an not empty archive?
Shutting it down the cluster is maybe also not an elegant way...

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions