Skip to content

fix(walrestore): use timeline-aware barman-cloud end-of-WAL markers#11133

Open
ardentperf wants to merge 3 commits into
cloudnative-pg:mainfrom
ardentperf:pr-fix-end-of-wal
Open

fix(walrestore): use timeline-aware barman-cloud end-of-WAL markers#11133
ardentperf wants to merge 3 commits into
cloudnative-pg:mainfrom
ardentperf:pr-fix-end-of-wal

Conversation

@ardentperf

Copy link
Copy Markdown
Contributor

A global end-of-WAL marker can be set by a parent-timeline prefetch miss and then consumed by a child-timeline restore request. In snapshot-restored replica flows, that can cause PostgreSQL to miss valid child-timeline WAL and replay wrong parent-timeline bytes. Reference cloudnative-pg/barman-cloud#276

Update in-tree wal-restore to use the new barman-cloud restorer APIs:

  • ConsumeEndOfWALStreamForWAL
  • SetEndOfWALStreamFromResults

Depends on cloudnative-pg/barman-cloud#277

@ardentperf ardentperf requested a review from a team as a code owner July 6, 2026 16:15
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 6, 2026
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.28 release-1.29 release-1.30 labels Jul 6, 2026
@dosubot dosubot Bot added the bug 🐛 Something isn't working label Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Linked issue missing.

Reference one in the PR body using a keyword (Closes / Fixes / Resolves / Refs / See) followed by #<issue_id> or owner/repo#<issue_id>.

Alternatively, apply the no-issue label to skip this check.

@jmealo

jmealo commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

👍 LGTM. This looks safe to me and could fix a lot of issues 🤔 .

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 8, 2026
ardentperf and others added 2 commits July 8, 2026 17:24
Update in-tree `wal-restore` to use the new `barman-cloud` restorer
APIs, resolving a bug that can cause replicas to enter a broken state
that CNPG cant recover from. Local marker naming, WAL timeline parsing,
and restore-result filtering policy now lives in
`github.com/cloudnative-pg/barman-cloud/pkg/restorer`. depends on
cloudnative-pg/barman-cloud#277

Signed-off-by: Jeremy Schneider <schneider@ardentperf.com>
…e-pg#277

Point barman-cloud at the fork branch behind
cloudnative-pg/barman-cloud#277 so this PR builds and CI can run, and
allow the replace directive in the linter configuration. Both changes
must be reverted in favor of an upstream barman-cloud release when
merging.

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
@armru armru force-pushed the pr-fix-end-of-wal branch from d255ad6 to a97b3b4 Compare July 8, 2026 15:24
@armru

armru commented Jul 8, 2026

Copy link
Copy Markdown
Member

/test

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/28954401725

@armru

armru commented Jul 9, 2026

Copy link
Copy Markdown
Member

/test

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/29002285379

The tests directory is a separate Go module, and replace directives
are only honored from the main module, so the fork replace in the root
go.mod does not apply when the e2e suite compiles the operator
packages. Mirror it in tests/go.mod so vet and the e2e build resolve
the barman-cloud fork too. To be reverted together with the root
replace once cloudnative-pg/barman-cloud#277 is merged and released.

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
@armru

armru commented Jul 9, 2026

Copy link
Copy Markdown
Member

/test

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/29005484149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases bug 🐛 Something isn't working lgtm This PR has been approved by a maintainer release-1.28 release-1.29 release-1.30 size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants