Repository navigation
recovery_target_action=pause to verify a PITR target before committing to it#11387Description
Is there an existing issue already for this feature request/idea?
- I have searched for an existing issue, and could not find anything. I believe this is a new feature request to be evaluated.
What problem is this feature going to solve? Why should it be added?
PostgreSQL's recovery_target_action lets a recovery pause once it reaches the configured target (recovery_target_action = pause), so an user can query the paused standby (hot_standby permitting) and confirm that's the right point before committing to it.
CloudNativePG does not expose this and actively forces the opposite: every recovery always promotes as soon as its target is reached, with no way to pause and inspect first.
This matters most for exactly the scenario PITR exists for: recovering from human error (a bad DELETE, a botched migration) where the "right" target usually isn't known precisely in advance and is found by trial and error against the actual data. Without a pause option, verifying a candidate targetTime against a Cluster today means deleting and recreating the whole restored cluster for every attempt, rather than nudging one paused, already-running instance forward.
Describe the solution you'd like
Add an action field to RecoveryTarget, mirroring recovery_target_action directly:
spec:
bootstrap:
recovery:
recoveryTarget:
targetTime: "2026-08-30 10:00:00+00"
action: pause # promote (default) | pauseNote
This is not a simple config passthrough: it requires a real change to the bootstrap flow, not just wiring a new field into getRestoreWalConfig.
Describe alternatives you've considered
- Reuse
recovery_target_actionverbatim as a free-form.spec.postgresql.parametersoverride, rather than a typedRecoveryTarget.Actionfield. Rejected: it's currently afixedConfigurationParameterfor good reason (the operator's readiness/health checks assumepromote), and a typed enum (promote/pause) gives the operator a place to hang the corresponding status/condition and validation logic, rather than parsing an arbitrary Postgres GUC value out of a free-form map. - A distinct "verify" mode instead of reusing
recovery_target_actiondirectly (a new field/annotation entirely separate from the Postgres GUC name), so the API doesn't imply Postgres's ownpause/promote/shutdownvocabulary is fully supported. Worth deciding explicitly during design, but starting with justpromote/pause(skippingshutdown, which doesn't fit a container-managed instance) keeps the surface small and still solves the real problem. - Do nothing and rely on backup/recreate cycles to trial-and-error a target. This is the status quo and exactly the friction this issue exists to remove.
Additional context
Requires #11228
Backport?
No
Are you willing to actively contribute to this feature?
Yes
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity