agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups
4+ messages / 3 participants
[nested] [flat]

* pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups
@ 2026-03-20 19:32 Andrew Dunstan <andrew@dunslane.net>
  2026-05-04 09:30 ` Re: pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 1 reply; 4+ messages in thread

From: Andrew Dunstan @ 2026-03-20 19:32 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_verifybackup: Enable WAL parsing for tar-format backups

Now that pg_waldump supports reading WAL from tar archives, remove the
restriction that forced --no-parse-wal for tar-format backups.

pg_verifybackup now automatically locates the WAL archive: it looks for
a separate pg_wal.tar first, then falls back to the main base.tar.  A
new --wal-path option (replacing the old --wal-directory, which is kept
as a silent alias) accepts either a directory or a tar archive path.

The default WAL directory preparation is deferred until the backup
format is known, since tar-format backups resolve the WAL path
differently from plain-format ones.

Author: Amul Sul <sulamul@gmail.com>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Reviewed-by: Jakub Wartak <jakub.wartak@enterprisedb.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Euler Taveira <euler@eulerto.com>
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
discussion: https://postgr.es/m/CAAJ_b94bqdWN3h2J-PzzzQ2Npbwct5ZQHggn_QoYGhC2rn-=WQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b3cf461b3cf91c586ab94b4dddd6dcd8ff8fec47

Modified Files
--------------
doc/src/sgml/ref/pg_verifybackup.sgml         | 14 ++--
src/bin/pg_verifybackup/pg_verifybackup.c     | 96 ++++++++++++++++++---------
src/bin/pg_verifybackup/t/002_algorithm.pl    |  4 --
src/bin/pg_verifybackup/t/003_corruption.pl   |  4 +-
src/bin/pg_verifybackup/t/007_wal.pl          | 20 +++++-
src/bin/pg_verifybackup/t/008_untar.pl        |  5 +-
src/bin/pg_verifybackup/t/010_client_untar.pl |  5 +-
7 files changed, 91 insertions(+), 57 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups
  2026-03-20 19:32 pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups Andrew Dunstan <andrew@dunslane.net>
@ 2026-05-04 09:30 ` Peter Eisentraut <peter@eisentraut.org>
  2026-05-04 11:16   ` Re: pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups Amul Sul <sulamul@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Peter Eisentraut @ 2026-05-04 09:30 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; pgsql-committers@lists.postgresql.org

On 20.03.26 20:32, Andrew Dunstan wrote:
> pg_verifybackup: Enable WAL parsing for tar-format backups
> 
> Now that pg_waldump supports reading WAL from tar archives, remove the
> restriction that forced --no-parse-wal for tar-format backups.
> 
> pg_verifybackup now automatically locates the WAL archive: it looks for
> a separate pg_wal.tar first, then falls back to the main base.tar.  A
> new --wal-path option (replacing the old --wal-directory, which is kept
> as a silent alias) accepts either a directory or a tar archive path.

In the past, we have opted against silent aliases when changing a 
command-line option.  All options should be documented, even if they are 
deprecated.  Otherwise, it's confusing for users moving between major 
versions or those who find that undocumented options happen to work. 
See commit 35ce24c333c for an example how this was done in the past.

I suggest the option --wal-directory should be added back to the 
documentation and help output.






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups
  2026-03-20 19:32 pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups Andrew Dunstan <andrew@dunslane.net>
  2026-05-04 09:30 ` Re: pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups Peter Eisentraut <peter@eisentraut.org>
@ 2026-05-04 11:16   ` Amul Sul <sulamul@gmail.com>
  2026-05-06 08:53     ` Re: pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 1 reply; 4+ messages in thread

From: Amul Sul @ 2026-05-04 11:16 UTC (permalink / raw)
  To: Peter Eisentraut <peter@eisentraut.org>; +Cc: Andrew Dunstan <andrew@dunslane.net>; pgsql-committers@lists.postgresql.org

On Mon, May 4, 2026 at 3:00 PM Peter Eisentraut <peter@eisentraut.org> wrote:
>
> On 20.03.26 20:32, Andrew Dunstan wrote:
> > pg_verifybackup: Enable WAL parsing for tar-format backups
> >
> > Now that pg_waldump supports reading WAL from tar archives, remove the
> > restriction that forced --no-parse-wal for tar-format backups.
> >
> > pg_verifybackup now automatically locates the WAL archive: it looks for
> > a separate pg_wal.tar first, then falls back to the main base.tar.  A
> > new --wal-path option (replacing the old --wal-directory, which is kept
> > as a silent alias) accepts either a directory or a tar archive path.
>
> In the past, we have opted against silent aliases when changing a
> command-line option.  All options should be documented, even if they are
> deprecated.  Otherwise, it's confusing for users moving between major
> versions or those who find that undocumented options happen to work.
> See commit 35ce24c333c for an example how this was done in the past.
>
> I suggest the option --wal-directory should be added back to the
> documentation and help output.

Agreed. Attached is a quick fix.

Regards,
Amul

Attachments:

  [application/octet-stream] 0001-Document-deprecated-wal-directory-option-for-pg_veri.patch (2.3K, ../../CAAJ_b95pj6rq4yw09Ds-7x8-HLHFbseJEXag5TDPb_CZewBgRA@mail.gmail.com/2-0001-Document-deprecated-wal-directory-option-for-pg_veri.patch)
  download | inline diff:
From d4aa4d4ff2da207c4bfd8ffeb0c03dce6a7cab67 Mon Sep 17 00:00:00 2001
From: Amul Sul <sulamul@gmail.com>
Date: Mon, 4 May 2026 16:40:46 +0530
Subject: [PATCH] Document deprecated --wal-directory option for
 pg_verifybackup
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Commit b3cf461b3cf91c586ab94b4dddd6dcd8ff8fec47 renamed
--wal-directory to --wal-path but retained the former as a silent
alias. Per project policy, all options—including deprecated
ones—should be documented to assist users transitioning between
versions.

This patch restores --wal-directory to the documentation and --help
output.
---
 doc/src/sgml/ref/pg_verifybackup.sgml     | 1 +
 src/bin/pg_verifybackup/pg_verifybackup.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/doc/src/sgml/ref/pg_verifybackup.sgml b/doc/src/sgml/ref/pg_verifybackup.sgml
index 1695cfe91c8..045516464a4 100644
--- a/doc/src/sgml/ref/pg_verifybackup.sgml
+++ b/doc/src/sgml/ref/pg_verifybackup.sgml
@@ -259,6 +259,7 @@ PostgreSQL documentation
      <varlistentry>
       <term><option>-w <replaceable class="parameter">path</replaceable></option></term>
       <term><option>--wal-path=<replaceable class="parameter">path</replaceable></option></term>
+      <term><option>--wal-directory=<replaceable class="parameter">path</replaceable></option> (deprecated)</term>
       <listitem>
        <para>
         Try to parse WAL files stored in the specified directory or tar
diff --git a/src/bin/pg_verifybackup/pg_verifybackup.c b/src/bin/pg_verifybackup/pg_verifybackup.c
index b60ab8739d5..4809a8b91e6 100644
--- a/src/bin/pg_verifybackup/pg_verifybackup.c
+++ b/src/bin/pg_verifybackup/pg_verifybackup.c
@@ -1399,6 +1399,7 @@ usage(void)
 	printf(_("  -q, --quiet                 do not print any output, except for errors\n"));
 	printf(_("  -s, --skip-checksums        skip checksum verification\n"));
 	printf(_("  -w, --wal-path=PATH         use specified path for WAL files\n"));
+	printf(_("  --wal-directory=PATH        (same as --wal-path, deprecated)\n"));
 	printf(_("  -V, --version               output version information, then exit\n"));
 	printf(_("  -?, --help                  show this help, then exit\n"));
 	printf(_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
-- 
2.47.1



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups
  2026-03-20 19:32 pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups Andrew Dunstan <andrew@dunslane.net>
  2026-05-04 09:30 ` Re: pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups Peter Eisentraut <peter@eisentraut.org>
  2026-05-04 11:16   ` Re: pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups Amul Sul <sulamul@gmail.com>
@ 2026-05-06 08:53     ` Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Peter Eisentraut @ 2026-05-06 08:53 UTC (permalink / raw)
  To: Amul Sul <sulamul@gmail.com>; +Cc: Andrew Dunstan <andrew@dunslane.net>; pgsql-committers@lists.postgresql.org

On 04.05.26 13:16, Amul Sul wrote:
> On Mon, May 4, 2026 at 3:00 PM Peter Eisentraut <peter@eisentraut.org> wrote:
>>
>> On 20.03.26 20:32, Andrew Dunstan wrote:
>>> pg_verifybackup: Enable WAL parsing for tar-format backups
>>>
>>> Now that pg_waldump supports reading WAL from tar archives, remove the
>>> restriction that forced --no-parse-wal for tar-format backups.
>>>
>>> pg_verifybackup now automatically locates the WAL archive: it looks for
>>> a separate pg_wal.tar first, then falls back to the main base.tar.  A
>>> new --wal-path option (replacing the old --wal-directory, which is kept
>>> as a silent alias) accepts either a directory or a tar archive path.
>>
>> In the past, we have opted against silent aliases when changing a
>> command-line option.  All options should be documented, even if they are
>> deprecated.  Otherwise, it's confusing for users moving between major
>> versions or those who find that undocumented options happen to work.
>> See commit 35ce24c333c for an example how this was done in the past.
>>
>> I suggest the option --wal-directory should be added back to the
>> documentation and help output.
> 
> Agreed. Attached is a quick fix.

Committed, thanks.






^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2026-05-06 08:53 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-03-20 19:32 pgsql: pg_verifybackup: Enable WAL parsing for tar-format backups Andrew Dunstan <andrew@dunslane.net>
2026-05-04 09:30 ` Peter Eisentraut <peter@eisentraut.org>
2026-05-04 11:16   ` Amul Sul <sulamul@gmail.com>
2026-05-06 08:53     ` Peter Eisentraut <peter@eisentraut.org>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox