Do we want to avoid checksumming extra files in the datadir? [was: BUG #19647]

From: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Edwin Polkerman <edwin(dot)polkerman(at)splendiddata(dot)com>
Subject: Do we want to avoid checksumming extra files in the datadir? [was: BUG #19647]
Date: 2026-09-03 17:10:36
Message-ID: CAOYmi+=E0zz+_MgQXAoOyn5C0vW53740izzRiTv6excqtCJfRg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Thu, Sep 3, 2026 at 9:49 AM Jacob Champion
<jacob(dot)champion(at)enterprisedb(dot)com> wrote:
> > I will file a bug report for this issue in github for the third-party extension pgactive. Please let me know if you want me to report an enhancement request or thet you take care about that
>
> I'm happy to shepherd the conversation over to -hackers, and will do
> that shortly. (I'm probably not the right person to drive it.)

Moving to -hackers.

I can't remember the last conversation I saw on dealing with
third-party files in our data directory, sorry. Occasionally we're
fine with them, and occasionally we try to parse apart their filenames
and fail during checksum operations. I don't think that's a bug, but
an actionable complaint from the bug report is that PG17 relaxed this
requirement for pg_basebackup [1] and not pg_checksums, which is kind
of weird.

The inciting event is that an extension drops a file called
pgactive.stat into global/. We could say "don't do that", in which
case I think we should follow Robert's idea in [1] and complain about
the existence of the file itself rather than the lack of checksummable
material. Or we could say "that's fine" and adjust pg_checksums to
continue onwards if the filename isn't what we expect.

Or we could decide that the existing behavior is what we want, and
adjust the following comment in pg_checksums.c to no longer refer to a
dead implementation:

> /*
> * List of files excluded from checksum validation.
> *
> * Note: this list should be kept in sync with what basebackup.c includes.
> */

and probably adjust this code so that it doesn't always print "segment
number 0", which isn't derived from the filename:

> segmentno = atoi(segmentpath);
> if (segmentno == 0)
> pg_fatal("invalid segment number %d in file name \"%s\"",
> segmentno, fn);

Or something else entirely. Thoughts?

Thanks,
--Jacob

[1] https://postgr.es/c/025584a16

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2026-09-03 17:20:52 Re: Do we want to avoid checksumming extra files in the datadir? [was: BUG #19647]
Previous Message Jacob Champion 2026-09-03 16:49:49 Re: BUG #19647: Difference in pg_basebackup behaviour between PostgreSQL <= 16 and >= 17 with pgactive extension

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-09-03 17:20:52 Re: Do we want to avoid checksumming extra files in the datadir? [was: BUG #19647]
Previous Message Andrey Borodin 2026-09-03 17:02:15 Re: Improving display of octal GUCs