forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd55241a
committed
Use whitelist to choose files scanned with pg_verify_checksums
The original implementation of pg_verify_checksums used a blacklist todecide which files should be skipped for scanning as they do not includedata checksums, like pg_internal.init or pg_control. However, thismissed two things:- Some files are created within builds of EXEC_BACKEND and these werenot listed, causing failures on Windows.- Extensions may create custom files in data folders, causing the toolto equally fail.This commit switches to a whitelist-like method instead by checking ifthe files to scan are authorized relation files. This is close to areverse-engineering of what is defined in relpath.c in charge ofbuilding the relation paths, and we could consider refactoring what thispatch does so as all routines are in a single place. This is left forlater.This is based on a suggestion from Andres Freund. TAP tests are updatedso as multiple file patterns are tested. The bug has been spotted byvarious buildfarm members as a result ofb34e84f which has introducedthe TAP tests of pg_verify_checksums.Author: Michael PaquierReviewed-by: Andrew Dunstan, Michael BanckDiscussion:https://postgr.es/m/20181012005614.GC26424@paquier.xyzBackpatch-through: 111 parent350410b commitd55241a
File tree
2 files changed
+116
-19
lines changed- src/bin/pg_verify_checksums
- t
2 files changed
+116
-19
lines changedLines changed: 61 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| 18 | + | |
18 | 19 |
| |
19 | 20 |
| |
20 | 21 |
| |
| |||
49 | 50 |
| |
50 | 51 |
| |
51 | 52 |
| |
52 |
| - | |
53 |
| - | |
54 |
| - | |
55 |
| - | |
56 |
| - | |
57 |
| - | |
58 |
| - | |
59 |
| - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
60 | 58 |
| |
61 |
| - | |
| 59 | + | |
62 | 60 |
| |
63 |
| - | |
64 |
| - | |
65 |
| - | |
66 |
| - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
67 | 86 |
| |
68 | 87 |
| |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
73 | 116 |
| |
74 | 117 |
| |
75 | 118 |
| |
| |||
146 | 189 |
| |
147 | 190 |
| |
148 | 191 |
| |
149 |
| - | |
| 192 | + | |
150 | 193 |
| |
151 | 194 |
| |
152 | 195 |
| |
|
Lines changed: 55 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
| 8 | + | |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
20 | 45 |
| |
21 | 46 |
| |
22 | 47 |
| |
| |||
67 | 92 |
| |
68 | 93 |
| |
69 | 94 |
| |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + |
0 commit comments
Comments
(0)