PostgreSQL directory format dump not supported anymore #314

Closed
opened 2020-05-18 13:11:26 +00:00 by rdunklau · 4 comments

Trying to perform a directory format dump with PostgreSQL

This used to be supported, and is very useful to avoid bloating a repository since in a directory backup, many files will not change from one backup to the next. This allows for a better reuse of chunks.

Steps to reproduce (if a bug)

Use the following configuration to dump the database:

postgresql_databases:
- name: mydb
format: directory
options: --compress 0

Actual behavior (if a bug)

The french pg_dump error says "no target directory given"

mai 18 14:33:02 tilleuls borgmatic[72086]: Command 'pg_dump --no-password --clean --if-exists --format directory --compress 0 mydb > /home/borg/.borgmatic/postgresql_databases/localhost/mydb' returned non-zero exit status 1.
mai 18 14:33:02 tilleuls borgmatic[72086]: CRITICAL pg_dump: erreur : aucun répertoire cible indiqué
mai 18 14:33:02 tilleuls borgmatic[72086]: CRITICAL Command 'pg_dump --no-password --clean --if-exists --format directory --compress 0 mydb > /home/borg/.borgmatic/postgresql_databases/localhost/mydb' returned non-zero exit s>
mai 18 14:33:02 tilleuls borgmatic[72086]: Need some help? https://torsion.org/borgmatic/#issues

Expected behavior (if a bug)

The dump should be performed in a (temp-ish) directory, then backed up

Other notes / implementation ideas

I think we should special case the directory format, since it can't redirect it's output to stdout.

Environment

borgmatic version: 1.5.4

borgmatic installation method: Archlinux package

Borg version: borg 1.1.11

Python version: Python 3.8.2

Database version (if applicable): PostgreSQL 12.3

operating system and version: Arch Linux

#### Trying to perform a directory format dump with PostgreSQL This used to be supported, and is very useful to avoid bloating a repository since in a directory backup, many files will not change from one backup to the next. This allows for a better reuse of chunks. #### Steps to reproduce (if a bug) Use the following configuration to dump the database: postgresql_databases: - name: mydb format: directory options: --compress 0 #### Actual behavior (if a bug) The french pg_dump error says "no target directory given" ``` mai 18 14:33:02 tilleuls borgmatic[72086]: Command 'pg_dump --no-password --clean --if-exists --format directory --compress 0 mydb > /home/borg/.borgmatic/postgresql_databases/localhost/mydb' returned non-zero exit status 1. mai 18 14:33:02 tilleuls borgmatic[72086]: CRITICAL pg_dump: erreur : aucun répertoire cible indiqué mai 18 14:33:02 tilleuls borgmatic[72086]: CRITICAL Command 'pg_dump --no-password --clean --if-exists --format directory --compress 0 mydb > /home/borg/.borgmatic/postgresql_databases/localhost/mydb' returned non-zero exit s> mai 18 14:33:02 tilleuls borgmatic[72086]: Need some help? https://torsion.org/borgmatic/#issues ``` #### Expected behavior (if a bug) The dump should be performed in a (temp-ish) directory, then backed up #### Other notes / implementation ideas I think we should special case the directory format, since it can't redirect it's output to stdout. #### Environment **borgmatic version:** 1.5.4 **borgmatic installation method:** Archlinux package **Borg version:** borg 1.1.11 **Python version:** Python 3.8.2 **Database version (if applicable):** PostgreSQL 12.3 **operating system and version:** Arch Linux
witten added the
bug
label 2020-05-18 15:38:39 +00:00
Owner

Thank you for bringing this to my attention! I obviously overlooked support for this directory format with the most recent release. I'll have a look at the code and see what, if anything, I can do given the new streaming database dump approach.

Thank you for bringing this to my attention! I obviously overlooked support for this directory format with the most recent release. I'll have a look at the code and see what, if anything, I can do given the new streaming database dump approach.
Owner

Okay, I have a fix for this implemented in master, and it'll go out as part of the next release. I'll mention it on this ticket when that happens.

Some details: When the "directory" dump format is selected now, borgmatic does not stream that database to/from Borg for either the dump or the restore. Instead, it writes out the directory dump to a temporary location on disk, and restores from there as well.

I also added a regression test that should catch this sort of issue in the future.

Thanks again for reporting this!

Okay, I have a fix for this implemented in master, and it'll go out as part of the next release. I'll mention it on this ticket when that happens. Some details: When the "directory" dump format is selected now, borgmatic does not stream that database to/from Borg for either the dump or the restore. Instead, it writes out the directory dump to a temporary location on disk, and restores from there as well. I also added a regression test that should catch this sort of issue in the future. Thanks again for reporting this!
Owner

Released in borgmatic 1.5.5!

Released in borgmatic 1.5.5!
Author

Thanks !

Thanks !
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#314
No description provided.