Barman v.3.4.0 and mutliple tablespace arguments

30 views
Skip to first unread message

John Scalia

unread,
Feb 23, 2024, 11:04:59 AMFeb 23
to Barman, Backup and Recovery Manager for PostgreSQL
I'm try to do a test for my new company. They would like to know how much time it takes to do a barman recover for the most barman backup for one of our production servers. This production server has some 6 tablespaces in it, and I can't seem to get barman to recover any more than one of them.

I've tried both multiple --tablespace arguments (didn't work), comma separated argument both with and without a space between then, as well as comma separated and enclosed by either single or double quotes, but none of these seem to work properly. The best result I've gotten so far is the one comma separated with no quoting, here it is:

barman recover --tablespace first_tbs:/pg_data/tablespace/first_tbs, second_tbs:/pg_data/tablespace/second_tbs --remote-ssh-command 'ssh user@recovery_server'' pg-db01 latest /pg_data/13/data

ls -l
total 0
drwx------ 2 postgres postgres  6 Feb 21 21:41 first_tbs
drwxrwxr-x 3 postgres postgres 21 Feb 23 15:02 first_tbs, second_tbs:

And you can see the 2nd directory entry is not quite correct. I'm inclined to think that multiple tablespaces should work, but how would I specify them?

And if this makes a difference, the O/S is Centos 7.release 7.9.2009. Yes, I'm aware Centos has been discontinued, but I'm aware of a plan here to migrate to Ubuntu this year, we just haven't changed this server yet.
--
Jay

Luca Ferrari

unread,
Feb 23, 2024, 12:07:45 PMFeb 23
to pgba...@googlegroups.com
On Fri, Feb 23, 2024 at 5:05 PM John Scalia <jaykno...@gmail.com> wrote:
>
> barman recover --tablespace first_tbs:/pg_data/tablespace/first_tbs, second_tbs:/pg_data/tablespace/second_tbs --remote-ssh-command 'ssh user@recovery_server'' pg-db01 latest /pg_data/13/data
>
what does the multiple tablespace options produce?

--tablespace first_tbs:/pg_data/tablespace/first_tbs --tablespace
second_tbs:/pg_data/tablespace/second_tbs

Luca

John Scalia

unread,
Feb 23, 2024, 12:17:34 PMFeb 23
to Barman, Backup and Recovery Manager for PostgreSQL

That causes the script to blow up almost immediately with:

barman: error: Unrecognized arguments: /pg_data/13/data

Martin Marques

unread,
Feb 23, 2024, 1:12:48 PMFeb 23
to pgba...@googlegroups.com
Hi,

> That causes the script to blow up almost immediately with:
>
> barman: error: Unrecognized arguments: /pg_data/13/data

Can you share the exact command line with the arguments you used and
all the output? I would like to see how all the arguments are parsed
by barman.

John Scalia

unread,
Feb 23, 2024, 1:40:08 PMFeb 23
to Barman, Backup and Recovery Manager for PostgreSQL
Sure: Here's the command with multiple --template arguments:

 barman recover --tablespace first_tbs:/pg_data/tablespace/first_tbs--tablespace second_tbs:/pg_data/tablespace/second_tbs --remote-ssh-command 'ssh post...@pg-restore.lab.company.com' pg-db01 latest /pg_data/13/data
usage: barman [-h] [-v] [-c CONFIG] [--color {never,always,auto}]
              [--log-level {NOTSET,DEBUG,INFO,WARNING,ERROR,CRITICAL}] [-q]
              [-d] [-f {json,console}]

              {archive-wal,backup,check,check-backup,check-wal-archive,cron,delete,diagnose,generate-manifest,get-wal,help,keep,list-backup,list-backups,list-files,list-server,list-servers,put-wal,rebuild-xlogdb,receive-wal,recover,replication-status,show-backup,show-backups,show-server,show-servers,status,switch-wal,switch-xlog,sync-backup,sync-info,sync-wals,verify,verify-backup}
              ...
barman: error: unrecognized arguments: /pg_data/13/data

Martin Marques

unread,
Feb 26, 2024, 4:26:12 AMFeb 26
to pgba...@googlegroups.com
There seems to be a missing space between
`first_tbs:/pg_data/tablespace/first_tbs` and `--tablespace`. Can you
confirm that there is a space there?
> --
> --
> You received this message because you are subscribed to the "Barman for PostgreSQL" group.
> To post to this group, send email to pgba...@googlegroups.com
> To unsubscribe from this group, send email to
> pgbarman+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/pgbarman?hl=en?hl=en-GB
>
> ---
> You received this message because you are subscribed to the Google Groups "Barman, Backup and Recovery Manager for PostgreSQL" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pgbarman+u...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/pgbarman/2fde2cdc-7154-4051-8f89-e20b1f2eb2d7n%40googlegroups.com.

John Scalia

unread,
Feb 26, 2024, 8:15:14 AMFeb 26
to Barman, Backup and Recovery Manager for PostgreSQL
There is definitely a space there between --tablespace and first_tbs. I doublechecked this on the actual server where I'm running the command.

John Scalia

unread,
Feb 26, 2024, 9:57:41 AMFeb 26
to Barman, Backup and Recovery Manager for PostgreSQL
Martin,
Your comment got me to check the entire command line, and somehow between the second_tbs and the --remote-ssh-command the space got omitted. Once I put that back in, the script ran until it encountered the 3rd tablespace which I hadn't included  yet. So, I added it, then the 4th tablespace, and finally the 5th tablespace, and it ran to completion, but I think this leads me to my last question. Why does the recover command demand so many iterations of the remote-ssh-command user's password?

But anyway, thanks for helping me find the error.
--
Jay

Martin Marques

unread,
Feb 27, 2024, 5:00:14 AMFeb 27
to pgba...@googlegroups.com
Hi,
>
> barman recover --tablespace first_tbs:/pg_data/tablespace/first_tbs--tablespace second_tbs:/pg_data/tablespace/second_tbs --remote-ssh-command 'ssh post...@pg-restore.lab.company.com' pg-db01 latest /pg_data/13/data
> usage: barman [-h] [-v] [-c CONFIG] [--color {never,always,auto}]
> [--log-level {NOTSET,DEBUG,INFO,WARNING,ERROR,CRITICAL}] [-q]
> [-d] [-f {json,console}]
>
> {archive-wal,backup,check,check-backup,check-wal-archive,cron,delete,diagnose,generate-manifest,get-wal,help,keep,list-backup,list-backups,list-files,list-server,list-servers,put-wal,rebuild-xlogdb,receive-wal,recover,replication-status,show-backup,show-backups,show-server,show-servers,status,switch-wal,switch-xlog,sync-backup,sync-info,sync-wals,verify,verify-backup}
> ...
> barman: error: unrecognized arguments: /pg_data/13/data

The error here indicates that there is some problem with the last
argument, which might mean that there is some character in the middle
of the CMD line. I would carefully right the command again, not
copying and pasting from some other source to make sure that all
arguments are valid ascii chars.

One other thing I would try is quoting each of the tablespace relocations.

John Scalia

unread,
Feb 27, 2024, 9:54:35 AMFeb 27
to Barman, Backup and Recovery Manager for PostgreSQL
Everything is working now since your earlier comment got me to doublecheck the command line. I'm now testing a PITR recovery, and will be writing up my findings today.
Reply all
Reply to author
Forward
0 new messages