feat(cluster): support named recovery target - #959
Open
philippemnoel wants to merge 1 commit into
Open
Conversation
philippemnoel
force-pushed
the
expose-recovery-target-name
branch
from
July 20, 2026 14:28
8a54fcc to
c6197f3
Compare
…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
force-pushed
the
expose-recovery-target-name
branch
from
July 20, 2026 14:30
c6197f3 to
b1aeca0
Compare
philippemnoel
marked this pull request as ready for review
July 20, 2026 14:30
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.
What
recovery.pitrTarget.name->recoveryTarget.targetNameandrecovery.pitrTarget.backupID->recoveryTarget.backupIDon theclusterchart, alongside the existingtime->targetTime.values.yaml,values.schema.json, the README, anddocs/Recovery.md.postgresql-minio-backup-restorechainsaw test to cover the named path.Why
recovery.pitrTargetonly supported a wall-clocktime. 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 withrecoveryTarget: Required value: BackupID is missingunlessbackupIDis given.backupIDis exposed in the same change for that reason.Backwards compatibility
recovery.pitrTarget.nameandrecovery.pitrTarget.backupIDdefault to"", and the template only emits a field when set. ApitrTargetwith justtime(or empty) renders identically to before.Tests
helm lint charts/cluster.helm template ... --show-only templates/cluster.yamlrendersrecoveryTarget.targetName/backupIDwhen set, and nothing whenpitrTargetis empty.postgresql-minio-backup-restorechainsaw test creates ano-bad-tablerestore point after the good write, then recovers from the object store withpitrTarget.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.