Re: [Patch] Make pg_checksums skip foreign tablespace directories

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Bernd Helmle <mailings@oopsware.de>
Cc: Michael Banck <michael.banck@credativ.de>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2020-02-27T06:48:21Z
Lists: pgsql-hackers
On Wed, Feb 26, 2020 at 06:02:22PM +0100, Bernd Helmle wrote:
> My feeling is that in the case we cannot successfully resolve a
> tablespace location from pg_tblspc, we should error out, but i could
> imagine that people would like to have just a warning instead.

Thanks, this patch is much cleaner in its approach, and I don't have
much to say about it except that the error message for lstat() should
be more consistent with the one above in scan_directory().  The
version for v11 has required a bit of rework, but nothing huge
either.

> I've updated the TAP test for pg_checksums by adding a dummy
> subdirectory into the tablespace directory already created for the
> corrupted relfilenode test, containing a file to process in case an
> unpatched pg_checksums is run. With the patch attached, these
> directories simply won't be considered to check.

What you have here is much more simple than the original proposal, so
I kept it.  Applied and back-patched down to 11.
--
Michael

Commits

  1. Skip foreign tablespaces when running pg_checksums/pg_verify_checksums

  2. Add prefix checks in exclude lists for pg_rewind, pg_checksums and base backups