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-18T06:15:34Z
Lists: pgsql-hackers
On Fri, Jan 31, 2020 at 11:33:34AM +0100, Bernd Helmle wrote:
> And to be honest, even PostgreSQL itself allows you to reuse tablespace
> locations for multiple instances as well, so the described problem
> should exist not in upgraded clusters only.

Fair point.  Now, while the proposed patch is right to use
TABLESPACE_VERSION_DIRECTORY, shouldn't we use strncmp based on the
length of TABLESPACE_VERSION_DIRECTORY instead of de->d_name?  It
seems also to me that the code as proposed is rather fragile, and that
we had better be sure that the check only happens when we are scanning
entries within pg_tblspc.

The issue with pg_internal.init.XX is quite different, so I think that
it would be better to commit that separately first.
--
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