From ab0aa6eddfdb7ad2ff78a22b8abd93bf03ebfce7 Mon Sep 17 00:00:00 2001 From: Konstantin Renner Date: Tue, 21 Apr 2026 09:41:28 +0200 Subject: [PATCH] fix(cnpg): Skip empty-WAL-archive pre-check on bootstrap.recovery MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The barman-cloud plugin v0.12.0 pre-check fails with "Expected empty archive" when bootstrap.recovery points at a pre-populated archive — it invokes barman-cloud-check-wal-archive without a --timeline hint, so any existing WAL segments trip it. This contradicts the symmetric-restore design: producer==consumer, seed + live backups share one path, and recovery must succeed against whatever is already there (latest backup, else migration seed). The cnpg.io/skipEmptyWalArchiveCheck=enabled annotation on the Cluster metadata disables the pre-check while leaving the actual restore path intact. Applied to ak-pg and pprl-pg. Velero follows the same pattern naturally (restore picks latest backup; tarball seed fills the gap when the Velero bucket is empty). Co-Authored-By: Claude Opus 4.7 (1M context) --- kubernetes/apps/authentik-db/postgres.yaml | 8 ++++++++ kubernetes/apps/paperless-db/postgres.yaml | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/kubernetes/apps/authentik-db/postgres.yaml b/kubernetes/apps/authentik-db/postgres.yaml index 291ecc52..27aa8788 100644 --- a/kubernetes/apps/authentik-db/postgres.yaml +++ b/kubernetes/apps/authentik-db/postgres.yaml @@ -3,6 +3,14 @@ kind: Cluster metadata: name: ak-pg namespace: authentik + annotations: + # Archive is pre-populated by the migration seed (base + WAL) and, + # on later reboots, by this cluster's own continuous archiving. The + # plugin's pre-recovery "Expected empty archive" check conflicts + # with the producer==consumer invariant of the symmetric-restore + # design, so skip it. bootstrap.recovery still reads latest backup + # from the archive; if none, it recovers the migration seed. + cnpg.io/skipEmptyWalArchiveCheck: "enabled" spec: instances: 2 imageName: ghcr.io/cloudnative-pg/postgresql:16 diff --git a/kubernetes/apps/paperless-db/postgres.yaml b/kubernetes/apps/paperless-db/postgres.yaml index 2a396763..724b6da5 100644 --- a/kubernetes/apps/paperless-db/postgres.yaml +++ b/kubernetes/apps/paperless-db/postgres.yaml @@ -3,6 +3,12 @@ kind: Cluster metadata: name: pprl-pg namespace: paperless + annotations: + # See authentik-db/postgres.yaml — same rationale: skip the + # plugin's pre-recovery "Expected empty archive" check so + # bootstrap.recovery works against a pre-populated archive + # (migration seed or later live backups). + cnpg.io/skipEmptyWalArchiveCheck: "enabled" spec: instances: 2 imageName: ghcr.io/cloudnative-pg/postgresql:16