feat: honor the operator's check_empty_wal_archive decision - #1009
Merged
Conversation
mnencia
force-pushed
the
dev/check-empty-wal-archive
branch
2 times, most recently
from
July 16, 2026 17:08
23d9092 to
19a4121
Compare
This was referenced Jul 16, 2026
Merged
armru
approved these changes
Jul 17, 2026
mnencia
force-pushed
the
dev/check-empty-wal-archive
branch
2 times, most recently
from
July 20, 2026 14:51
664f808 to
f635b24
Compare
Archive() and the restore job hook each re-derived, on their own, whether to verify the WAL archive destination is empty, by reading a Cluster annotation and, for Archive, an on-disk marker file. That decision belongs to the operator, which already tracks both the annotation and the marker file's lifecycle. Honor cnpg-i's new WALArchiveRequest/RestoreRequest field CheckEmptyWalArchive when the operator sets it: obey it directly, without re-inspecting the marker file. Only fall back to the previous annotation-and-marker-file logic when talking to an operator that predates this field. Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
The WAL archive hook and the restore job hook each derived, inline, whether to verify the archive destination before proceeding. Pull each decision into a small function so the operator-decision-versus-fallback logic can be exercised on its own. Behavior is unchanged: archiving still fails on a marker-file stat error, and restore still falls back to the Cluster annotation alone. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Add unit coverage for the WAL archive and restore-job decision helpers. The tables pin the version-skew contract: when the operator sets the decision it overrides both the Cluster annotation and, for archiving, the on-disk marker file, while a nil decision (an operator that predates the field) reproduces the previous annotation-based behavior. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
leonardoce
force-pushed
the
dev/check-empty-wal-archive
branch
from
July 21, 2026 15:15
f635b24 to
bba751a
Compare
leonardoce
requested review from
NiccoloFei,
fcanovai,
gbartolini and
leonardoce
as code owners
July 21, 2026 15:15
leonardoce
approved these changes
Jul 21, 2026
armru
approved these changes
Jul 21, 2026
1 task
ajgon
pushed a commit
to deedee-ops/home-ops
that referenced
this pull request
Jul 29, 2026
…oud (v0.13.0 ➔ v0.14.0) (#465) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [cloudnative-pg/plugin-barman-cloud](https://github.com/cloudnative-pg/plugin-barman-cloud) | minor | `v0.13.0` → `v0.14.0` | --- ### Release Notes <details> <summary>cloudnative-pg/plugin-barman-cloud (cloudnative-pg/plugin-barman-cloud)</summary> ### [`v0.14.0`](https://github.com/cloudnative-pg/plugin-barman-cloud/releases/tag/v0.14.0) [Compare Source](cloudnative-pg/plugin-barman-cloud@v0.13.0...v0.14.0) ##### Features - Honor the operator's check\_empty\_wal\_archive decision ([#​1009](cloudnative-pg/plugin-barman-cloud#1009)) ([7bcb74b](cloudnative-pg/plugin-barman-cloud@7bcb74b)) ##### Bug Fixes - **deps:** Update all non-major go dependencies ([#​963](cloudnative-pg/plugin-barman-cloud#963)) ([f949241](cloudnative-pg/plugin-barman-cloud@f949241)) - **deps:** Update all non-major go dependencies ([#​979](cloudnative-pg/plugin-barman-cloud#979)) ([bf52833](cloudnative-pg/plugin-barman-cloud@bf52833)) - **deps:** Update all non-major go dependencies ([#​982](cloudnative-pg/plugin-barman-cloud#982)) ([5f84ecc](cloudnative-pg/plugin-barman-cloud@5f84ecc)) - **deps:** Update all non-major go dependencies to [`53ffbf0`](cloudnative-pg/plugin-barman-cloud@53ffbf0) ([#​973](cloudnative-pg/plugin-barman-cloud#973)) ([7190349](cloudnative-pg/plugin-barman-cloud@7190349)) - **deps:** Update all non-major go dependencies to [`592f761`](cloudnative-pg/plugin-barman-cloud@592f761) ([#​972](cloudnative-pg/plugin-barman-cloud#972)) ([2fa63c4](cloudnative-pg/plugin-barman-cloud@2fa63c4)) - **deps:** Update all non-major go dependencies to [`8d9302e`](cloudnative-pg/plugin-barman-cloud@8d9302e) ([#​975](cloudnative-pg/plugin-barman-cloud#975)) ([0c687cb](cloudnative-pg/plugin-barman-cloud@0c687cb)) - **deps:** Update all non-major go dependencies to v2.30.0 ([#​957](cloudnative-pg/plugin-barman-cloud#957)) ([61b82ce](cloudnative-pg/plugin-barman-cloud@61b82ce)) - **deps:** Update documentation dependencies to v3.10.2 ([#​1001](cloudnative-pg/plugin-barman-cloud#1001)) ([88f2e29](cloudnative-pg/plugin-barman-cloud@88f2e29)) - **deps:** Update github.com/cloudnative-pg/barman-cloud digest to [`950b0f5`](cloudnative-pg/plugin-barman-cloud@950b0f5) ([#​1022](cloudnative-pg/plugin-barman-cloud#1022)) ([98537c4](cloudnative-pg/plugin-barman-cloud@98537c4)) - **deps:** Update k8s.io/utils digest to [`a95e086`](cloudnative-pg/plugin-barman-cloud@a95e086) ([#​968](cloudnative-pg/plugin-barman-cloud#968)) ([f7f0136](cloudnative-pg/plugin-barman-cloud@f7f0136)) - **deps:** Update k8s.io/utils digest to [`be93311`](cloudnative-pg/plugin-barman-cloud@be93311) ([#​986](cloudnative-pg/plugin-barman-cloud#986)) ([2cc4e99](cloudnative-pg/plugin-barman-cloud@2cc4e99)) - **deps:** Update kubernetes monorepo to v0.36.2 ([#​958](cloudnative-pg/plugin-barman-cloud#958)) ([030b28c](cloudnative-pg/plugin-barman-cloud@030b28c)) - **deps:** Update kubernetes monorepo to v0.36.3 ([#​1031](cloudnative-pg/plugin-barman-cloud#1031)) ([ce81794](cloudnative-pg/plugin-barman-cloud@ce81794)) - **deps:** Update module github.com/cloudnative-pg/cnpg-i to v0.6.0 ([#​1021](cloudnative-pg/plugin-barman-cloud#1021)) ([13450a3](cloudnative-pg/plugin-barman-cloud@13450a3)) - **deps:** Update module google.golang.org/grpc to v1.82.1 ([#​1008](cloudnative-pg/plugin-barman-cloud#1008)) ([3c27364](cloudnative-pg/plugin-barman-cloud@3c27364)) - **docs:** Fix broken anchor link in concepts.md ([#​1013](cloudnative-pg/plugin-barman-cloud#1013)) ([9c84d06](cloudnative-pg/plugin-barman-cloud@9c84d06)) - Inject barman sidecar in replica clusters bootstrapped with pg\_basebackup ([#​965](cloudnative-pg/plugin-barman-cloud#965)) ([eb5e860](cloudnative-pg/plugin-barman-cloud@eb5e860)) - Reduce startupProbe periodSeconds without losing failure tolerance ([#​992](cloudnative-pg/plugin-barman-cloud#992)) ([bf95543](cloudnative-pg/plugin-barman-cloud@bf95543)), refs [#​991](cloudnative-pg/plugin-barman-cloud#991) - Restore WAL from replica source during designated primary promotion ([#​966](cloudnative-pg/plugin-barman-cloud#966)) ([c34b232](cloudnative-pg/plugin-barman-cloud@c34b232)) - **walrestore:** Serve pg\_rewind without prefetching and flag machinery ([#​1007](cloudnative-pg/plugin-barman-cloud#1007)) ([fb3f0f9](cloudnative-pg/plugin-barman-cloud@fb3f0f9)) </details> --- ### Configuration 📅 **Schedule**: (in timezone Europe/Warsaw) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yODUuMiIsInVwZGF0ZWRJblZlciI6IjQzLjI4NS4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbInJlbm92YXRlL2dpdGh1Yi1yZWxlYXNlIiwidHlwZS9taW5vciJdfQ==--> Reviewed-on: https://git.ajgon.casa/deedee/mark13/pulls/465
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Archive() and the restore job hook each re-derived, on their own, whether to verify the WAL archive destination is empty, by reading a Cluster annotation and, for Archive, an on-disk marker file. That decision belongs to the operator, which already tracks both the annotation and the marker file's lifecycle.
Honor cnpg-i's new WALArchiveRequest/RestoreRequest field CheckEmptyWalArchive when the operator sets it: obey it directly, without re-inspecting the marker file. Only fall back to the previous annotation-and-marker-file logic when talking to an operator that predates this field.
Related: cloudnative-pg/cnpg-i#353 adds the field this depends on; cloudnative-pg/cloudnative-pg#11216 is the operator-side counterpart.