feat(pitr): support POSTGRES_RECOVERY_TARGET_TYPE=immediate#74
Closed
paulocsanz wants to merge 1 commit into
Closed
feat(pitr): support POSTGRES_RECOVERY_TARGET_TYPE=immediate#74paulocsanz 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 — specifically, brand-new sources with zero committed transactions. The picker (mono PR) sets this env var when the probe sees `noCommitsYet`; the wrapper then runs `pgbackrest restore --type=immediate` (no `--target` value) and writes `recovery_target = 'immediate'` to `postgresql.auto.conf`. Postgres stops at end-of-base-backup consistency with no WAL replay past `pg_backup_stop`. Precedence: `_TYPE=immediate` > `_XID` > `_TIME`. Existing `_TIME` and `_XID` paths are unchanged.
Closed
3 tasks
Contributor
Author
|
Pivoting to a simpler approach: have the backup-watcher emit one transactional commit after each successful backup, so noCommitsYet stops being a real state. 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
Adds a third recovery target type for restoring brand-new clusters that have a base backup but zero committed transactions to anchor
recovery_target_timeagainst.POSTGRES_RECOVERY_TARGET_TYPE=immediate. When set, the wrapper runspgbackrest restore --type=immediate(no--target) and writesrecovery_target = 'immediate'topostgresql.auto.conf. Postgres stops at end-of-base-backup consistency, no WAL replay pastpg_backup_stop._TYPE=immediate>_XID>_TIME.configure_pgbackrest_recoveryandrestore_from_pgbackrest_if_empty_volumegates to accept any of the three vars.Context
Pairs with the mono picker change (which sets the env var when the probe flags
noCommitsYet) and the postgres-ha sibling PR. Replaces the dead-end UX where a fresh cluster with a base backup couldn't be restored unless the user wrote a dummy row to seedpg_commit_ts/.Test plan
WAL_RECOVER_FROM_*+POSTGRES_RECOVERY_TARGET_TYPE=immediateon an empty volume — image runspgbackrest restore --type=immediate, postgres comes up promoted at base-backup consistency._TIME-only path still works (regression)._XID-over-_TIMEprecedence still works (regression).bash -n wrapper.shsyntax-clean.