get-wal clarifications needed

5 views
Skip to first unread message

JK Laiho

unread,
Jan 23, 2026, 11:47:24 AM (13 days ago) Jan 23
to Barman, Backup and Recovery Manager for PostgreSQL
Hi,

I'm a bit lost in the documentation with regards to get-wal.

I'm doing a "full streaming" (backup_method=postgres + streaming_archiver=true) backup of the main cluster of a PostgreSQL 14 server to a freshly built backup server with Barman 3.17.

In order to recover from accidental data loss (mistaken deletes etc.), the method we've planned is to set up a new cluster called restore on the original DB server, as it has enough disk space to hold the data twice over. With the cluster set up (but not running) and its data directory empty, we'd run this on the Barman server:

barman restore --remote-ssh-command "ssh postgres@db" --target-time <ts> db latest /var/lib/postgresql/14/restore

...where <ts> is before the data loss. Start up the restore cluster, connect, retrieve the data, recreate it on main; then shut down and remove the cluster. But what confuses me a bit is whether to use the get-wal functionality or not.

With either --get-wal on the restore command or recovery_options=get-wal in the config file, the docs say this:

Use --get-wal to configure Postgres to fetch WALs from Barman during recovery. If not set, Barman will copy all the WALs required for Postgres recovery as part of the restore command.

This, then, requires postgres on the DB server to be able to SSH to as barman to the Barman server, i.e. the reverse of what --remote-ssh-command needs.

It seems from the docs that this is the only automated way of handling .partial WAL files in an automated way during restores when streaming_archiver is used. This opens up a couple of questions:

  1. Why can't a no-get-wal restore copy the partial WAL over along with the completed WAL files? Is it a currently unimplemented feature, or some fundamental limitation?
  2. Under Limitations of .partial WAL files, the docs say about the no-get-wal case: you can copy the partial WAL file located in the streaming_wals_directory to the staging wal directory on the destination node, renaming it without the .partial suffix. This certainly suggests that in point no. 1 we're not talking about a fundamental limitation, if the .partial file is just copyable without any other processing. This implies you have to create that staging WAL directory beforehand, being careful with correct ownership and permissions. So in our case, /var/lib/postgresql/14/restore/barman_wal, since we've not set --staging-wal-directory to something else. Is this correct?
  3. Apart from the minor hassle of setting up the SSH connectivity both ways between the DB and Barman servers, is there any reason why I wouldn't want to always use get-wal?
Thanks in advance for your help.
Reply all
Reply to author
Forward
0 new messages