Re: [Patch] Make pg_checksums skip foreign tablespace directories
Bernd Helmle <mailings@oopsware.de>
From: Bernd Helmle <mailings@oopsware.de>
To: Michael Paquier <michael@paquier.xyz>
Cc: Michael Banck <michael.banck@credativ.de>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2020-02-24T12:11:10Z
Lists: pgsql-hackers
On Fri, 2020-02-21 at 15:36 +0900, Michael Paquier wrote: > We don't do that for the normal directory scan path, so it does not > strike me as a good idea on consistency ground. As a whole, I don't > see much point in having a separate routine which is just roughly a > duplicate of scan_directory(), and I think that we had better just > add > the check looking for matches with TABLESPACE_VERSION_DIRECTORY > directly when having a directory, if subdir is "pg_tblspc". That > also makes the patch much shorter. To be honest, i dislike both: The other doubles logic (note: i don't see it necessarily as 100% code duplication, since the semantic of scan_tablespaces() is different: it serves as a driver for scan_directories() and just resolves entries in pg_tblspc directly). The other makes scan_directories() complicater to read and special cases just a single directory in an otherwise more or less generic function. E.g. it makes me uncomfortable if we get a pg_tblspc somewhere else than PGDATA (if someone managed to create such a directory in a foreign tablespace location for example), so we should maintain an additional check if we really operate on the pg_tblspc we have to. That was the reason(s) i've moved it into a separate function. That said, i'll provide an updated patch with your ideas. Bernd
Commits
-
Skip foreign tablespaces when running pg_checksums/pg_verify_checksums
- 8f9aba1874ec 11.8 landed
- f6e8e8b3809b 12.3 landed
- 428a2609ef64 13.0 landed
-
Add prefix checks in exclude lists for pg_rewind, pg_checksums and base backups
- da2a7180aa0e 11.8 landed
- a8beece956eb 12.3 landed
- bf883b211eae 13.0 landed