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

Add support for the Patroni Spilo database for backups #69

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ikethecoder
Copy link

No description provided.

Copy link
Member

@WadeBarnes WadeBarnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ikethecoder, Would it be possible to add support by using a maintained base image? Including all of the related /patroni-spilo/root/ scripts and templates greatly increases the maintenance efforts moving forward.

Also, does the regular Postgres backup-container not work for backing up your patroni (Postgres based) databases? If not were does it fall short? There are teams using the regular Postgres backup container for backing up patroni databases.

@ikethecoder
Copy link
Author

Hi @WadeBarnes I was reluctant to create a separate image specifically for the backup-container - those scripts under "/patroni-spilo/root/" are not part of the Spilo base image, they are only needed to get the backup.sh to work. I'll trim the scripts to bare minimum to see what is left - if its still too much then I suppose can pull it out into a bcgov repo.

I had quite a bit of trouble getting backup-container to work with a database dump from a Spilo-based Patroni cluster using the existing Postgres image (I never got it working cleanly for full cycle of backup/validate/restore). Spilo adds some specific extensions (pg_stat_statements,pg_stat_kcache,set_user) that were not in the Postgres 12 base image used in backup-container, which caused the validate database phase to fail - partly for missing extensions and partly for missing Roles (admin, robot_zmon) on Grants). This is what led me down the path of starting with Spilo in the backup image, and then adding in the "/root/*" bundle of scripts like "run-postgresql" to get backup.sh to work.

I have been looking at both the "platform services" Patroni image/deployment and the Spilo Patroni image/deployment - and I have found Spilo to be very stable with it handling graceful shutdown nicely when Pods are terminated - something that the platform patroni image doesn't seem to do well.

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

Successfully merging this pull request may close these issues.

2 participants