plugin-barman-cloud/internal/cnpgi
Armando Ruocco fb3f0f9dab
fix(walrestore): serve pg_rewind without prefetching and flag machinery (#1007)
When a demoted primary rejoins the cluster after a failover, the
instance manager runs `pg_rewind --restore-target-wal`, and the
resulting `restore_command` invocations are served by this sidecar
exactly as if an instance in recovery were asking. pg_rewind walks the
timeline backwards, fetches every WAL file it needs exactly once, and
treats any restore failure as fatal, so two optimizations meant for
recovery break it: prefetching the following segments is wasted work
that, past the end of the timeline, is guaranteed to end in an archive
miss, and the end-of-wal-stream flag recorded by that miss makes a later
invocation fail without contacting the object store, on a segment the
archive actually has, aborting the whole rewind.

The restore request now carries the context it is made in
(cloudnative-pg/cnpg-i#351). When it says `MODE_REWIND`, the sidecar
restores exactly the requested file: no prefetching, no
end-of-wal-stream flag check, no flag recording. Requests from operators
predating the field keep the current behavior.

This is the plugin-side counterpart of
cloudnative-pg/cloudnative-pg#11204. The cnpg-i dependency points to a
pseudo-version of the protocol pull request and will move to the next
tagged release once it is available.

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2026-07-21 15:01:51 +02:00
..
common fix(walrestore): serve pg_rewind without prefetching and flag machinery (#1007) 2026-07-21 15:01:51 +02:00
instance fix(deps): update module sigs.k8s.io/controller-runtime to v0.24.0 (#880) 2026-05-06 10:15:29 +02:00
metadata chore(main): release 0.13.0 (#860) 2026-06-10 10:55:17 +02:00
operator fix: reduce startupProbe periodSeconds without losing failure tolerance (#992) 2026-07-09 10:36:09 +02:00
restore feat: pass additionalCommandArgs to barman-cloud-restore (#914) 2026-06-03 14:17:12 +02:00