feat(pitr): support POSTGRES_RECOVERY_TARGET_TYPE=immediate#30
Closed
paulocsanz wants to merge 1 commit into
Closed
feat(pitr): support POSTGRES_RECOVERY_TARGET_TYPE=immediate#30paulocsanz wants to merge 1 commit into
paulocsanz wants to merge 1 commit into
Conversation
Add a third recovery target type for clusters where neither `_TIME` nor `_XID` can anchor recovery. When `POSTGRES_RECOVERY_TARGET_TYPE` is `immediate`, the patroni-runner writes `recovery_target = 'immediate'` to postgresql.auto.conf so Postgres stops at end-of-base-backup consistency without needing a target value. Precedence: `_TYPE=immediate` > `_XID` > `_TIME`, matching postgres-ssl. Existing `_TIME` and `_XID` paths are unchanged.
Collaborator
Author
|
Pivoting to a simpler approach: have the backup-watcher emit one transactional commit after each successful backup. New PR will follow. |
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.
Summary
Mirror of the postgres-ssl change for the Patroni runner: support
POSTGRES_RECOVERY_TARGET_TYPE=immediatefor restoring brand-new clusters that have a base backup but no committed transactions to anchor recovery against.config.rs: newpitr_target_immediate: boolfrom the env var.patroni_runner.rs:configure_pitr_recoverywritesrecovery_target = 'immediate'(no value) when on the immediate branch. Precedence_TYPE=immediate>_XID>_TIME, matching postgres-ssl. Caller gate accepts any of the three.Context
Pairs with
postgres-sslPR (#74) and the mono picker change. Restored services are postgres-ssl (per the existing patroni→ssl image swap instageInitialPITRRestorePatch), so this change mostly covers the in-place HA-replay path that exists for symmetry.Test plan
cargo checkclean.POSTGRES_RECOVERY_TARGET_TYPE=immediateon an HA node withWAL_RECOVER_FROM_*— patroni-runner stagesrecovery_target = 'immediate'and postgres comes up promoted at base-backup consistency._TIME-only and_XID-over-_TIMEpaths still work (regression).