Re: pg_waldump: support decoding of WAL inside tarfile

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Michael Paquier <michael(at)paquier(dot)xyz>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Amul Sul <sulamul(at)gmail(dot)com>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_waldump: support decoding of WAL inside tarfile
Date: 2026-03-28 22:18:03
Message-ID: 1624716.1774736283@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Munro <thomas(dot)munro(at)gmail(dot)com> writes:
> It seems like the place we'd be looking for the file is in
> astreamer_tar_header(), so I added in some caveman debugging:

> XXXX [PaxHeader/000000010000000000000002] XXXX
> XXXX [GNUSparseFile.0/000000010000000000000002] XXXX

After a bit of research, I see the problem: your tar has decided to
store 000000010000000000000002 as a sparse file, and evidently it
inserts "GNUSparseFile.0/" into the file name when it does that.
Our tar-parsing logic will not recognize that name as being one
of the WAL files it wants; and even if it did, it doesn't know
how to de-sparse the file contents, so it would get the wrong
output.

I'm pretty disinclined to try to support sparse files here,
especially with ~10 days till feature freeze.

However ... I do not find any indication in the GNU tar docs
that it produces sparse files by default. It looks like you
need to say -S/--sparse to make that happen. Maybe you have
a version that's been hacked to make that the default?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-03-28 22:36:57 Re: pg_waldump: support decoding of WAL inside tarfile
Previous Message Thomas Munro 2026-03-28 22:08:43 Re: pg_waldump: support decoding of WAL inside tarfile