Re: pg_checksums (or checksums in general) vs tableam - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: pg_checksums (or checksums in general) vs tableam
Date
Msg-id CABUevExT2u-xirnuHoWm79TdgBySZK3Pw3zsVyRmUmgxi31DoA@mail.gmail.com
Whole thread Raw
In response to Re: pg_checksums (or checksums in general) vs tableam  (Michael Paquier <michael@paquier.xyz>)
Responses Re: pg_checksums (or checksums in general) vs tableam  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Wed, Jul 10, 2019 at 3:05 PM Michael Paquier <michael@paquier.xyz> wrote:
On Wed, Jul 10, 2019 at 11:42:34AM +0200, Magnus Hagander wrote:
> pg_checksums enumerate the files. What if there are files there from a
> different tableam? Isn't pg_checksums just going to badly fail then, since
> it assumes everything is heap?
>
> Also, do we allow AMs that don't support checksumming data? Do we have any
> checks for tables created with such AMs in a system that has checksums
> enabled?

Table AMs going through shared buffers and smgr.c, like zedstore,
share the same page header, meaning that the on-disk file is the same
as heap, and that checksums are compiled similarly to heap.
pg_checksums is not going to complain on those ones and would work
just fine.

Table AMs using their own storage layer (which would most likely use
their own checksum method normally?) would be ignored by pg_checksums
if the file names don't match what smgr uses, but it could result in
failures if they use on-disk file names which match.

That would be fine, if we actually knew. Should we (or have we already?) defined a rule that they are not allowed to use the same naming standard unless they have the same type of header?

--

pgsql-hackers by date:

Previous
From: Ashwin Agrawal
Date:
Subject: Re: PGOPTIONS="-fh" make check gets stuck since Postgres 11
Next
From: Andres Freund
Date:
Subject: Re: pg_checksums (or checksums in general) vs tableam