Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replica only backup. #2297

Closed
thedolphin opened this issue Mar 10, 2024 · 3 comments
Closed

Replica only backup. #2297

thedolphin opened this issue Mar 10, 2024 · 3 comments
Assignees
Labels

Comments

@thedolphin
Copy link

Feature request

If leader has archive_mode = off, then on replica archive-mode-check=n should be automatically applied and backup should proceed. That means WALs are collected from replica only and backup is taken from replica only too.

@dwsteele
Copy link
Member

We have discussed this a feature but it has not made it onto the roadmap. One issue is that we are not guaranteed to get the last WAL segment in the archive when the backup ends, i.e. we cannot guarantee the consistency of the backup.

Also, I did a pretty extensive review of replication and recovery when developing our current method and I was not satisfied with the backup from standby-only approach -- mainly copying pg_control last and expecting it to contain the correct values. Backup from primary appears safer and more reproducible.

@thedolphin
Copy link
Author

I mean, while pgpackrest has access to the leader to make any checks for proper backup generation, leader's archive_mode setting check should not be the show stopper.

Okay, my scenario: I have pretty old legacy instance of non-interruptable postgres with no archive_mode set. I made a replica with archive_mode and archive_command set. pgbackrest has access to leader via ssh and counter part pgbackrest. Now I want to start backup from replica. At this point I have to restart leader to set archive_mode, while I will never backup from leader, because i will switch to new replica soon.

@dwsteele
Copy link
Member

That seems pretty specific to your use case so I can't see us supporting it. If we do support backup from standby-only it will be in the case where access to the primary is not possible/preferred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants