pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Use whitelist to choose files scanned with pg_verify_checksums 2+ messages / 1 participants [nested] [flat]
* pgsql: Use whitelist to choose files scanned with pg_verify_checksums @ 2018-10-19 13:49 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 2+ messages in thread From: Michael Paquier @ 2018-10-19 13:49 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use whitelist to choose files scanned with pg_verify_checksums The original implementation of pg_verify_checksums used a blacklist to decide which files should be skipped for scanning as they do not include data checksums, like pg_internal.init or pg_control. However, this missed two things: - Some files are created within builds of EXEC_BACKEND and these were not listed, causing failures on Windows. - Extensions may create custom files in data folders, causing the tool to equally fail. This commit switches to a whitelist-like method instead by checking if the files to scan are authorized relation files. This is close to a reverse-engineering of what is defined in relpath.c in charge of building the relation paths, and we could consider refactoring what this patch does so as all routines are in a single place. This is left for later. This is based on a suggestion from Andres Freund. TAP tests are updated so as multiple file patterns are tested. The bug has been spotted by various buildfarm members as a result of b34e84f which has introduced the TAP tests of pg_verify_checksums. Author: Michael Paquier Reviewed-by: Andrew Dunstan, Michael Banck Discussion: https://postgr.es/m/20181012005614.GC26424@paquier.xyz Backpatch-through: 11 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/cc7f27eae888234d2fda9e0eaadbeb33a48cd274 Modified Files -------------- src/bin/pg_verify_checksums/pg_verify_checksums.c | 79 +++++++++++++++++------ 1 file changed, 61 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Use whitelist to choose files scanned with pg_verify_checksums @ 2018-10-19 13:49 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 2+ messages in thread From: Michael Paquier @ 2018-10-19 13:49 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use whitelist to choose files scanned with pg_verify_checksums The original implementation of pg_verify_checksums used a blacklist to decide which files should be skipped for scanning as they do not include data checksums, like pg_internal.init or pg_control. However, this missed two things: - Some files are created within builds of EXEC_BACKEND and these were not listed, causing failures on Windows. - Extensions may create custom files in data folders, causing the tool to equally fail. This commit switches to a whitelist-like method instead by checking if the files to scan are authorized relation files. This is close to a reverse-engineering of what is defined in relpath.c in charge of building the relation paths, and we could consider refactoring what this patch does so as all routines are in a single place. This is left for later. This is based on a suggestion from Andres Freund. TAP tests are updated so as multiple file patterns are tested. The bug has been spotted by various buildfarm members as a result of b34e84f which has introduced the TAP tests of pg_verify_checksums. Author: Michael Paquier Reviewed-by: Andrew Dunstan, Michael Banck Discussion: https://postgr.es/m/20181012005614.GC26424@paquier.xyz Backpatch-through: 11 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/d55241af705667d4503638e3f77d3689fd6be31d Modified Files -------------- src/bin/pg_verify_checksums/pg_verify_checksums.c | 79 +++++++++++++++++------ src/bin/pg_verify_checksums/t/002_actions.pl | 56 +++++++++++++++- 2 files changed, 116 insertions(+), 19 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2018-10-19 13:49 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-10-19 13:49 pgsql: Use whitelist to choose files scanned with pg_verify_checksums Michael Paquier <michael@paquier.xyz> 2018-10-19 13:49 pgsql: Use whitelist to choose files scanned with pg_verify_checksums Michael Paquier <michael@paquier.xyz>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox