Skip to content

[Feature]: Support recovery_target_action=pause to verify a PITR target before committing to it #11387

Description

@gbartolini

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) | pause

Note

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_action verbatim as a free-form .spec.postgresql.parameters override, rather than a typed RecoveryTarget.Action field. Rejected: it's currently a fixedConfigurationParameter for good reason (the operator's readiness/health checks assume promote), 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_action directly (a new field/annotation entirely separate from the Postgres GUC name), so the API doesn't imply Postgres's own pause/promote/shutdown vocabulary is fully supported. Worth deciding explicitly during design, but starting with just promote/pause (skipping shutdown, 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

Activity

  1. added this to the Next milestone on Aug 31, 2026
  2. self-assigned this
    on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement 🪄no-stale

Projects

  • Status
    No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions