Skip to content

feat(cluster): support named recovery target - #959

Open
philippemnoel wants to merge 1 commit into
cloudnative-pg:mainfrom
paradedb:expose-recovery-target-name
Open

feat(cluster): support named recovery target#959
philippemnoel wants to merge 1 commit into
cloudnative-pg:mainfrom
paradedb:expose-recovery-target-name

Conversation

@philippemnoel

@philippemnoel philippemnoel commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What

  • Expose recovery.pitrTarget.name -> recoveryTarget.targetName and recovery.pitrTarget.backupID -> recoveryTarget.backupID on the cluster chart, alongside the existing time -> targetTime.
  • Document them in values.yaml, values.schema.json, the README, and docs/Recovery.md.
  • Extend the postgresql-minio-backup-restore chainsaw test to cover the named path.

Why

recovery.pitrTarget only supported a wall-clock time. A named restore point (pg_create_restore_point) recovers to an exact WAL location, which is deterministic. CloudNativePG can pick the base backup to start replay from for a time target, but not for a name (or LSN/xid), so it rejects a named target with recoveryTarget: Required value: BackupID is missing unless backupID is given. backupID is exposed in the same change for that reason.

Backwards compatibility

recovery.pitrTarget.name and recovery.pitrTarget.backupID default to "", and the template only emits a field when set. A pitrTarget with just time (or empty) renders identically to before.

Tests

  • helm lint charts/cluster.
  • helm template ... --show-only templates/cluster.yaml renders recoveryTarget.targetName/backupID when set, and nothing when pitrTarget is empty.
  • The postgresql-minio-backup-restore chainsaw test creates a no-bad-table restore point after the good write, then recovers from the object store with pitrTarget.name + backupID (read from the source backup's .status.backupId), asserting the pre-restore-point table is present and the post-restore-point table absent.

@philippemnoel
philippemnoel force-pushed the expose-recovery-target-name branch from 8a54fcc to c6197f3 Compare July 20, 2026 14:28
…me / backupID)

Point-in-time recovery could only target a timestamp
(recovery.pitrTarget.time -> recoveryTarget.targetTime). Add
recovery.pitrTarget.name -> recoveryTarget.targetName so a recovery can
target a named restore point (pg_create_restore_point), and
recovery.pitrTarget.backupID -> recoveryTarget.backupID.

A named target needs backupID: CloudNativePG can pick the base backup to
start replay from for a time target, but not for a name (or LSN/xid). The
recoveryTarget block is only emitted when one of the fields is set, so
time-only recoveries render unchanged. Document the fields in values.yaml,
values.schema.json, README and docs/Recovery.md, and cover the path in the
postgresql-minio-backup-restore chainsaw test.

Signed-off-by: Philippe Noël <philippemnoel@gmail.com>
@philippemnoel
philippemnoel force-pushed the expose-recovery-target-name branch from c6197f3 to b1aeca0 Compare July 20, 2026 14:30
@philippemnoel philippemnoel changed the title feat(cluster): support named recovery target (recoveryTarget.targetNa… feat(cluster): support named recovery target Jul 20, 2026
@philippemnoel
philippemnoel marked this pull request as ready for review July 20, 2026 14:30
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 20, 2026
@NiccoloFei NiccoloFei added the chart( cluster ) Related to the cluster chart label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chart( cluster ) Related to the cluster chart size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants