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

Use pg_basebackup for database backups #302

Merged
merged 5 commits into from
Oct 25, 2017

Conversation

carbonin
Copy link
Member

This PR changes the tool we use for database backups from pg_dump to pg_basebackup

This allows for a more comprehensive backup which includes all databases in the cluster as well as the current state of postgresql config files.

For restore we want to continue to support restoring databases which were backed-up using pg_dump so I added file type detection to switch between which restore method we use.

For pg_basebackup-created files we stop the database, replace the contents of the data directory with the contents of the archive, fix up permissions, and start the database back up.

pg_dump based restore remains unchanged

https://bugzilla.redhat.com/show_bug.cgi?id=1495192

This will allow us to backup all databases in the cluster as well
as config files.

https://bugzilla.redhat.com/show_bug.cgi?id=1495192
We can just call .unload_pglogical_extension directly from
.restore_pg_compress
This commit allows us to support both the new, pg_basebackup
method of backup as well as the old pg_dump method.

The pg_basebackup output is just a tgz file of the contents of
the data directory, so restore is just replacing the current data
directory with the data in the archive.

https://bugzilla.redhat.com/show_bug.cgi?id=1495192
@miq-bot
Copy link
Member

miq-bot commented Oct 25, 2017

Checked commits carbonin/manageiq-gems-pending@271febd~...42e8e30 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. ⭐

Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

@gtanzillo gtanzillo added this to the Sprint 72 Ending Oct 30, 2017 milestone Oct 25, 2017
@gtanzillo gtanzillo merged commit a52b508 into ManageIQ:master Oct 25, 2017
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Oct 25, 2017
Starting with this PR: ManageIQ/manageiq-gems-pending#302
PostgresAdmin added file existence and file moves in the backup and
restore code.  We need to mock these for now until we find a cleaner way
to test this.
@carbonin carbonin deleted the use_pg_basebackup branch December 1, 2017 13:47
NickLaMuro added a commit to NickLaMuro/manageiq-gems-pending that referenced this pull request May 10, 2018
Removed as part of:

  ManageIQ#302

In commit 271febd

  ManageIQ@271febd3

Also adds some tests for future confirmation that other additions and
refactoring will not brake what is already here.
NickLaMuro added a commit to NickLaMuro/manageiq-appliance_console that referenced this pull request Mar 5, 2021
Removed as part of:

  ManageIQ/manageiq-gems-pending#302

In commit 0502002e

  ManageIQ/manageiq-gems-pending@0502002e

Also adds some tests for future confirmation that other additions and
refactoring will not brake what is already here.


(transferred from ManageIQ/manageiq-gems-pending@9dcbe55)
NickLaMuro added a commit to NickLaMuro/manageiq-appliance_console that referenced this pull request Mar 5, 2021
Removed as part of:

  ManageIQ/manageiq-gems-pending#302

In commit d07f2f69

  ManageIQ/manageiq-gems-pending@d07f2f69

Also adds some tests for future confirmation that other additions and
refactoring will not brake what is already here.


(transferred from ManageIQ/manageiq-gems-pending@9dcbe55)
NickLaMuro added a commit to NickLaMuro/manageiq-appliance_console that referenced this pull request Mar 5, 2021
Removed as part of:

  ManageIQ/manageiq-gems-pending#302

In commit d07f2f69

  ManageIQ/manageiq-gems-pending@d07f2f69

Also adds some tests for future confirmation that other additions and
refactoring will not brake what is already here.


(transferred from ManageIQ/manageiq-gems-pending@9dcbe55)
NickLaMuro added a commit to NickLaMuro/manageiq-appliance_console that referenced this pull request Mar 9, 2021
Removed as part of:

  ManageIQ/manageiq-gems-pending#302

In commit e10af7bb

  ManageIQ/manageiq-gems-pending@e10af7bb

Also adds some tests for future confirmation that other additions and
refactoring will not brake what is already here.


(transferred from ManageIQ/manageiq-gems-pending@9dcbe55)
NickLaMuro added a commit to NickLaMuro/manageiq-appliance_console that referenced this pull request Mar 9, 2021
Removed as part of:

  ManageIQ/manageiq-gems-pending#302

In commit 69e001e8

  ManageIQ/manageiq-gems-pending@69e001e8

Also adds some tests for future confirmation that other additions and
refactoring will not brake what is already here.


(transferred from ManageIQ/manageiq-gems-pending@9dcbe55)
NickLaMuro added a commit to NickLaMuro/manageiq-appliance_console that referenced this pull request Mar 9, 2021
Removed as part of:

  ManageIQ/manageiq-gems-pending#302

In commit 69e001e8

  ManageIQ/manageiq-gems-pending@69e001e8

Also adds some tests for future confirmation that other additions and
refactoring will not brake what is already here.


(transferred from ManageIQ/manageiq-gems-pending@9dcbe55)
NickLaMuro added a commit to NickLaMuro/manageiq-appliance_console that referenced this pull request Mar 11, 2021
Removed as part of:

  ManageIQ/manageiq-gems-pending#302

In commit 69e001e8

  ManageIQ/manageiq-gems-pending@69e001e8

Also adds some tests for future confirmation that other additions and
refactoring will not brake what is already here.


(transferred from ManageIQ/manageiq-gems-pending@9dcbe55)
NickLaMuro added a commit to NickLaMuro/manageiq-appliance_console that referenced this pull request Mar 16, 2021
Removed as part of:

  ManageIQ/manageiq-gems-pending#302

In commit 69e001e8

  ManageIQ/manageiq-gems-pending@69e001e8

Also adds some tests for future confirmation that other additions and
refactoring will not brake what is already here.


(transferred from ManageIQ/manageiq-gems-pending@9dcbe55)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants